diff --git a/.gitignore b/.gitignore index 7ca469a..1aa21ac 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,7 @@ dist/ .DS_Store .idea/ .vscode/ + +# Python bytecode +__pycache__/ +*.py[cod] diff --git a/server/.gitattributes b/server/.gitattributes new file mode 100644 index 0000000..1fbf887 --- /dev/null +++ b/server/.gitattributes @@ -0,0 +1 @@ +* linguist-language=GO \ No newline at end of file diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..a314378 --- /dev/null +++ b/server/.gitignore @@ -0,0 +1,39 @@ +.buildpath +.hgignore.swp +.project +.orig +.swp +.idea/ +.settings/ +.vscode/ +vendor/ +composer.lock +pkg/ +cbuild +**/.DS_Store +/test/ +main +output/ +manifest/config/config.yaml +manifest/output/ +resource/log/ +resource/public/admin/ +resource/public/attachment/ +storage/cache/ +storage/diskqueue/ +storage/cert/ssl/server.crt +storage/cert/ssl/server.key +storage/cert/pay/alipay/ +storage/cert/pay/wxpay/ +temp/ +logs/ +main.exe +main.exe~ +*.exe +*.log +*.zip +.idea +!hotgo/ +*.lock +/bin/package.sh +internal/packed/packed.go diff --git a/server/.golangci.yml b/server/.golangci.yml new file mode 100644 index 0000000..94f158a --- /dev/null +++ b/server/.golangci.yml @@ -0,0 +1,287 @@ +## This file contains all available configuration options +## with their default values. + +# See https://github.com/golangci/golangci-lint#config-file +# See https://golangci-lint.run/usage/configuration/ + +# Options for analysis running. +run: + # Exit code when at least one issue was found. + # Default: 1 + issues-exit-code: 2 + + # Include test files or not. + # Default: true + tests: false + go: "1.20" + + # Which dirs to skip: issues from them won't be reported. + # Can use regexp here: `generated.*`, regexp is applied on full path. + # Default value is empty list, + # but default dirs are skipped independently of this option's value (see skip-dirs-use-default). + # "/" will be replaced by current OS file path separator to properly work on Windows. + # skip-dirs: + # - internal/library/hggen/internal + + # Which files to skip: they will be analyzed, but issues from them won't be reported. + # Default value is empty list, + # but there is no need to include all autogenerated files, + # we confidently recognize autogenerated files. + # If it's not please let us know. + # "/" will be replaced by current OS file path separator to properly work on Windows. + # skip-files: [] + + +# Main linters configurations. +# See https://golangci-lint.run/usage/linters +linters: + # Disable all default enabled linters. + disable-all: true + # Custom enable linters we want to use. + enable: + - errcheck # Errcheck is a program for checking for unchecked errors in go programs. + - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. + - funlen # Tool for detection of long functions + - goconst # Finds repeated strings that could be replaced by a constant + - gocritic # Provides diagnostics that check for bugs, performance and style issues. +# - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification + - gosimple # Linter for Go source code that specializes in simplifying code + - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string + - misspell # Finds commonly misspelled English words in comments + - nolintlint # Reports ill-formed or insufficient nolint directives + - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. + - staticcheck # It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. + - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code + - usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. + - whitespace # Tool for detection of leading and trailing whitespace + + +issues: + exclude-rules: + # helpers in tests often (rightfully) pass a *testing.T as their first argument + - path: _test\.go + text: "context.Context should be the first parameter of a function" + linters: + - revive + # Yes, they are, but it's okay in a test + - path: _test\.go + text: "exported func.*returns unexported type.*which can be annoying to use" + linters: + - revive + # https://github.com/go-critic/go-critic/issues/926 + - linters: + - gocritic + text: "unnecessaryDefer:" + exclude-dirs: + - internal/library/hggen/internal + exclude-files: [] + + +# https://golangci-lint.run/usage/linters +linters-settings: + # https://golangci-lint.run/usage/linters/#misspell + misspell: + locale: US + ignore-words: + - cancelled + + # https://golangci-lint.run/usage/linters/#revive + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md + revive: + ignore-generated-header: true + severity: error + rules: + - name: atomic + - name: line-length-limit + severity: error + arguments: [ 1024 ] + - name: unhandled-error + severity: warning + disabled: true + arguments: [] + - name: var-naming + severity: warning + disabled: true + arguments: + # AllowList + - [ "ID","URL","IP","HTTP","JSON","API","UID","Id","Api","Uid","Http","Json","Ip","Url" ] + # DenyList + - [ "VM" ] + - name: string-format + severity: warning + disabled: false + arguments: + - - 'core.WriteError[1].Message' + - '/^([^A-Z]|$)/' + - must not start with a capital letter + - - 'fmt.Errorf[0]' + - '/(^|[^\.!?])$/' + - must not end in punctuation + - - panic + - '/^[^\n]*$/' + - must not contain line breaks + - name: function-result-limit + severity: warning + disabled: false + arguments: [ 4 ] + + # https://golangci-lint.run/usage/linters/#funlen + funlen: + # Checks the number of lines in a function. + # If lower than 0, disable the check. + # Default: 60 + lines: 330 + # Checks the number of statements in a function. + # If lower than 0, disable the check. + # Default: 40 + statements: -1 + + # https://golangci-lint.run/usage/linters/#goconst + goconst: + # Minimal length of string constant. + # Default: 3 + min-len: 4 + # Minimum occurrences of constant string count to trigger issue. + # Default: 3 + # For subsequent optimization, the value is reduced. + min-occurrences: 30 + # Ignore test files. + # Default: false + ignore-tests: true + # Look for existing constants matching the values. + # Default: true + match-constant: false + # Search also for duplicated numbers. + # Default: false + numbers: true + # Minimum value, only works with goconst.numbers + # Default: 3 + min: 5 + # Maximum value, only works with goconst.numbers + # Default: 3 + max: 20 + # Ignore when constant is not used as function argument. + # Default: true + ignore-calls: false + + # https://golangci-lint.run/usage/linters/#gocritic + gocritic: + disabled-checks: + - ifElseChain + - assignOp + - appendAssign + - singleCaseSwitch + - regexpMust + - typeSwitchVar + - elseif + + # https://golangci-lint.run/usage/linters/#gosimple + gosimple: + # Select the Go version to target. + # Default: 1.13 + # Deprecated: use the global `run.go` instead. + # go: "1.15" + # Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks + # Default: ["*"] + checks: [ + "all", "-S1000", "-S1001", "-S1002", "-S1008", "-S1009", "-S1016", "-S1023", "-S1025", "-S1029", "-S1034", "-S1040" + ] + + # https://golangci-lint.run/usage/linters/#govet + govet: + # Report about shadowed variables. + # Default: false + # check-shadowing: true + # Settings per analyzer. + settings: + # Analyzer name, run `go tool vet help` to see all analyzers. + printf: + # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). + # Default: [] + funcs: + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + # shadow: + # Whether to be strict about shadowing; can be noisy. + # Default: false + # strict: false + unusedresult: + # Comma-separated list of functions whose results must be used + # (in addition to defaults context.WithCancel,context.WithDeadline,context.WithTimeout,context.WithValue, + # errors.New,fmt.Errorf,fmt.Sprint,fmt.Sprintf,sort.Reverse) + # Default [] + funcs: + - pkg.MyFunc + - context.WithCancel + # Comma-separated list of names of methods of type func() string whose results must be used + # (in addition to default Error,String) + # Default [] + stringmethods: + - MyMethod + # Enable all analyzers. + # Default: false + enable-all: true + # Disable analyzers by name. + # Run `go tool vet help` to see all analyzers. + # Default: [] + disable: + - asmdecl + - assign + - atomic + - atomicalign + - bools + - buildtag + - cgocall + - composites + - copylocks + - deepequalerrors + - errorsas + - fieldalignment + - findcall + - framepointer + - httpresponse + - ifaceassert + - loopclosure + - lostcancel + - nilfunc + - nilness + - reflectvaluecompare + - shift + - shadow + - sigchanyzer + - sortslice + - stdmethods + - stringintconv + - structtag + - testinggoroutine + - tests + - unmarshal + - unreachable + - unsafeptr + - unusedwrite + + # https://golangci-lint.run/usage/linters/#staticcheck + staticcheck: + # Select the Go version to target. + # Default: "1.13" + # Deprecated: use the global `run.go` instead. + # go: "1.15" + # SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks + # Default: ["*"] + checks: [ "all","-SA1019","-SA4015","-SA1029","-SA1016","-SA9003","-SA4006","-SA6003" ] + + # https://golangci-lint.run/usage/linters/#gofmt + gofmt: + # Simplify code: gofmt with `-s` option. + # Default: true + simplify: true + # Apply the rewrite rules to the source before reformatting. + # https://pkg.go.dev/cmd/gofmt + # Default: [] + rewrite-rules: [ ] + # - pattern: 'interface{}' + # replacement: 'any' + # - pattern: 'a[b:len(a)]' + # replacement: 'a[b:]' \ No newline at end of file diff --git a/server/Makefile b/server/Makefile new file mode 100644 index 0000000..9731f00 --- /dev/null +++ b/server/Makefile @@ -0,0 +1,113 @@ +ROOT_DIR = $(shell pwd) +NAMESPACE = "default" +DEPLOY_NAME = "template-single" +DOCKER_NAME = "template-single" +ADMIN_RESOURCE_PATH = "/resource/public/admin/" + +# 一键编译。编译web前端,并将编译后的包移动到服务端对应静态资源路径下,最后编译服务端 +.PHONY: build +build: + @rm -rf ./$(ADMIN_RESOURCE_PATH) + @mkdir ./$(ADMIN_RESOURCE_PATH) + @cd ../web && pnpm run build && \cp -rf ./dist/* ../server$(ADMIN_RESOURCE_PATH) + @cd ../server + @echo "y" | gf build + +# 通过热编译启动所有服务 +.PHONY: all +all: + gf run main.go --args "all" + +.PHONY: http +http: + gf run main.go --args "http" + +.PHONY: queue +queue: + gf run main.go --args "queue" + +.PHONY: cron +cron: + gf run main.go --args "cron" + +.PHONY: auth +auth: + gf run main.go --args "auth" + +# 启动web服务 +.PHONY: web +web: + @cd ../web && pnpm run dev + +# 刷新casbin权限 +.PHONY: refresh +refresh: + @go run main.go tools -m=casbin -a1=refresh + +# 清理casbin权限 +.PHONY: clear +clear: + @go run main.go tools -m=casbin -a1=clear + +# 运行代码质量分析工具 +# https://github.com/ywanbing/golangci +.PHONY: lint +lint: + golangci-lint run + +.PHONY: killmain +killmain: + @kill -9 $(ps -ef|grep main|grep -v grep|awk '{print $2}') + +# Install/Update to the latest CLI tool. +.PHONY: cli +cli: + @set -e; \ + wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(shell go env GOOS)_$(shell go env GOARCH) && \ + chmod +x gf && \ + ./gf install -y && \ + rm ./gf + +# Check and install CLI tool. +.PHONY: cli.install +cli.install: + @set -e; \ + gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \ + echo "GoFame CLI is not installed, start proceeding auto installation..."; \ + make cli; \ + fi; + +# Generate Go files for DAO/DO/Entity. +.PHONY: dao +dao: cli.install + @gf gen dao + +# Generate Go files for Service. +.PHONY: service +service: cli.install + @gf gen service + +# Build image, deploy image and yaml to current kubectl environment and make port forward to local machine. +.PHONY: start +start: + @set -e; \ + make image; \ + make deploy; \ + make port; + +# Build docker image and commit to the repository. +# example: make image tag=v0.0.1 +.PHONY: image +image: + @echo "y" | gf docker main.go -p -tn hotgo:$(tag) + +# Deploy image and yaml to current kubectl environment. +.PHONY: deploy +deploy: + $(eval _TAG = $(if ${TAG}, ${TAG}, develop)) + @set -e; \ + mkdir -p $(ROOT_DIR)/temp/kustomize;\ + cd $(ROOT_DIR)/manifest/deploy/kustomize/overlays/${_TAG};\ + kustomize build > $(ROOT_DIR)/temp/kustomize.yaml;\ + kubectl apply -f $(ROOT_DIR)/temp/kustomize.yaml; \ + kubectl patch -n $(NAMESPACE) deployment/$(DEPLOY_NAME) -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(shell date +%s)\"}}}}}"; diff --git a/server/README.MD b/server/README.MD new file mode 100644 index 0000000..67735c3 --- /dev/null +++ b/server/README.MD @@ -0,0 +1 @@ +## HotGo 管理后台服务端 \ No newline at end of file diff --git a/server/addons/addons.go b/server/addons/addons.go new file mode 100644 index 0000000..aa1b522 --- /dev/null +++ b/server/addons/addons.go @@ -0,0 +1,6 @@ +// Package addons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package addons diff --git a/server/addons/hgexample/README.MD b/server/addons/hgexample/README.MD new file mode 100644 index 0000000..8fa3944 --- /dev/null +++ b/server/addons/hgexample/README.MD @@ -0,0 +1,39 @@ +## 功能案例 + +### 简介 + +系统的一些功能案例 + + +### 使用说明 + +系统自带的功能使用示例及其说明,包含一些简单的交互 + + +### 安装 + +1、安装 HotGo (2.11.4及以上) + +项目介绍:https://github.com/bufanyun/hotgo + +2、将当前插件项目拷贝进 HotGo 根目录的 server/addons 目录下 + +3、在 HotGo 根目录的 server/addons/modules 目录下创建go文件:hgexample.go,内容如下: +```go +package modules + +import _ "hotgo/addons/hgexample" +``` + +4、HotGo 后台进入 开发工具->插件管理->找到 功能案例 (hgexample) 进行安装 + +5、重启服务即可生效 + + +### 常用命令行 + +```shell +# 接口维护-gen service +gf gen service -s=addons/hgexample/logic -d=addons/hgexample/service + +``` diff --git a/server/addons/hgexample/api/admin/comp/import.go b/server/addons/hgexample/api/admin/comp/import.go new file mode 100644 index 0000000..75bd097 --- /dev/null +++ b/server/addons/hgexample/api/admin/comp/import.go @@ -0,0 +1,26 @@ +// Package comp +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package comp + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" +) + +// ImportExcelReq 导入Excel +type ImportExcelReq struct { + g.Meta `path:"/comp/importExcel" method:"post" tags:"功能案例" summary:"导入Excel"` + File *ghttp.UploadFile `json:"file" type:"file" dc:"分片文件"` +} + +type ImportExcelSheet struct { + Sheet string `json:"sheet"` + Rows [][]string `json:"rows"` +} + +type ImportExcelRes struct { + Sheets []*ImportExcelSheet `json:"sheets"` +} diff --git a/server/addons/hgexample/api/admin/config/config.go b/server/addons/hgexample/api/admin/config/config.go new file mode 100644 index 0000000..83b431f --- /dev/null +++ b/server/addons/hgexample/api/admin/config/config.go @@ -0,0 +1,30 @@ +// Package config +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package config + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" +) + +// GetReq 获取指定分组的配置 +type GetReq struct { + g.Meta `path:"/config/get" method:"get" tags:"配置" summary:"获取指定分组的配置"` + sysin.GetConfigInp +} + +type GetRes struct { + *sysin.GetConfigModel +} + +// UpdateReq 获取指定分组的配置 +type UpdateReq struct { + g.Meta `path:"/config/update" method:"post" tags:"配置" summary:"获取指定分组的配置"` + sysin.UpdateConfigInp +} + +type UpdateRes struct { +} diff --git a/server/addons/hgexample/api/admin/index/index.go b/server/addons/hgexample/api/admin/index/index.go new file mode 100644 index 0000000..764eaa8 --- /dev/null +++ b/server/addons/hgexample/api/admin/index/index.go @@ -0,0 +1,21 @@ +// Package index +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package index + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" +) + +// TestReq 测试 +type TestReq struct { + g.Meta `path:"/index/test" method:"get" tags:"功能案例" summary:"测试"` + sysin.IndexTestInp +} + +type TestRes struct { + *sysin.IndexTestModel +} diff --git a/server/addons/hgexample/api/admin/table/table.go b/server/addons/hgexample/api/admin/table/table.go new file mode 100644 index 0000000..368c4dc --- /dev/null +++ b/server/addons/hgexample/api/admin/table/table.go @@ -0,0 +1,83 @@ +// Package table +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package table + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/internal/model/input/form" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/table/list" method:"get" tags:"表格例子" summary:"获取表格列表"` + sysin.TableListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.TableListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出列表 +type ExportReq struct { + g.Meta `path:"/table/export" method:"get" tags:"表格例子" summary:"导出表格列表"` + sysin.TableListInp +} + +type ExportRes struct{} + +// ViewReq 获取信息 +type ViewReq struct { + g.Meta `path:"/table/view" method:"get" tags:"表格例子" summary:"获取指定信息"` + sysin.TableViewInp +} + +type ViewRes struct { + *sysin.TableViewModel +} + +// EditReq 修改/新增 +type EditReq struct { + g.Meta `path:"/table/edit" method:"post" tags:"表格例子" summary:"修改/新增表格"` + sysin.TableEditInp +} + +type EditRes struct{} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/table/delete" method:"post" tags:"表格例子" summary:"删除表格"` + sysin.TableDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/table/maxSort" method:"get" tags:"表格例子" summary:"表格最大排序"` + sysin.TableMaxSortInp +} + +type MaxSortRes struct { + *sysin.TableMaxSortModel +} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/table/status" method:"post" tags:"表格例子" summary:"更新表格状态"` + sysin.TableStatusInp +} + +type StatusRes struct{} + +// SwitchReq 更新开关状态 +type SwitchReq struct { + g.Meta `path:"/table/switch" method:"post" tags:"表格例子" summary:"更新表格状态"` + sysin.TableSwitchInp +} + +type SwitchRes struct{} diff --git a/server/addons/hgexample/api/admin/tenantorder/tenantorder.go b/server/addons/hgexample/api/admin/tenantorder/tenantorder.go new file mode 100644 index 0000000..edb8c2e --- /dev/null +++ b/server/addons/hgexample/api/admin/tenantorder/tenantorder.go @@ -0,0 +1,59 @@ +// Package tenantorder +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.13.1 +package tenantorder + +import ( + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/internal/model/input/form" + + "github.com/gogf/gf/v2/frame/g" +) + +// ListReq 查询多租户功能演示列表 +type ListReq struct { + g.Meta `path:"/tenantOrder/list" method:"get" tags:"多租户功能演示" summary:"获取多租户功能演示列表"` + sysin.TenantOrderListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.TenantOrderListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出多租户功能演示列表 +type ExportReq struct { + g.Meta `path:"/tenantOrder/export" method:"get" tags:"多租户功能演示" summary:"导出多租户功能演示列表"` + sysin.TenantOrderListInp +} + +type ExportRes struct{} + +// ViewReq 获取多租户功能演示指定信息 +type ViewReq struct { + g.Meta `path:"/tenantOrder/view" method:"get" tags:"多租户功能演示" summary:"获取多租户功能演示指定信息"` + sysin.TenantOrderViewInp +} + +type ViewRes struct { + *sysin.TenantOrderViewModel +} + +// EditReq 修改/新增多租户功能演示 +type EditReq struct { + g.Meta `path:"/tenantOrder/edit" method:"post" tags:"多租户功能演示" summary:"修改/新增多租户功能演示"` + sysin.TenantOrderEditInp +} + +type EditRes struct{} + +// DeleteReq 删除多租户功能演示 +type DeleteReq struct { + g.Meta `path:"/tenantOrder/delete" method:"post" tags:"多租户功能演示" summary:"删除多租户功能演示"` + sysin.TenantOrderDeleteInp +} + +type DeleteRes struct{} \ No newline at end of file diff --git a/server/addons/hgexample/api/admin/treetable/treetable.go b/server/addons/hgexample/api/admin/treetable/treetable.go new file mode 100644 index 0000000..d5ebb96 --- /dev/null +++ b/server/addons/hgexample/api/admin/treetable/treetable.go @@ -0,0 +1,92 @@ +// Package treetable +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package treetable + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/internal/model/input/form" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/treeTable/list" method:"get" tags:"树形表格例子" summary:"获取表格列表"` + sysin.TreeTableListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.TreeTableListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出列表 +type ExportReq struct { + g.Meta `path:"/treeTable/export" method:"get" tags:"树形表格例子" summary:"导出表格列表"` + sysin.TableListInp +} + +type ExportRes struct{} + +// ViewReq 获取信息 +type ViewReq struct { + g.Meta `path:"/treeTable/view" method:"get" tags:"树形表格例子" summary:"获取指定信息"` + sysin.TableViewInp +} + +type ViewRes struct { + *sysin.TableViewModel +} + +// EditReq 修改/新增 +type EditReq struct { + g.Meta `path:"/treeTable/edit" method:"post" tags:"树形表格例子" summary:"修改/新增表格"` + sysin.TableEditInp +} + +type EditRes struct{} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/treeTable/delete" method:"post" tags:"树形表格例子" summary:"删除表格"` + sysin.TableDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/treeTable/maxSort" method:"get" tags:"树形表格例子" summary:"表格最大排序"` + sysin.TableMaxSortInp +} + +type MaxSortRes struct { + *sysin.TableMaxSortModel +} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/treeTable/status" method:"post" tags:"树形表格例子" summary:"更新表格状态"` + sysin.TableStatusInp +} + +type StatusRes struct{} + +// SwitchReq 更新开关状态 +type SwitchReq struct { + g.Meta `path:"/treeTable/switch" method:"post" tags:"树形表格例子" summary:"更新表格状态"` + sysin.TableSwitchInp +} + +type SwitchRes struct{} + +// SelectReq 树形选项 +type SelectReq struct { + g.Meta `path:"/treeTable/select" method:"get" tags:"树形表格例子" summary:"树形选项"` +} + +type SelectRes struct { + List []*sysin.TableTree `json:"list" dc:"数据列表"` +} diff --git a/server/addons/hgexample/api/api/index/index.go b/server/addons/hgexample/api/api/index/index.go new file mode 100644 index 0000000..764eaa8 --- /dev/null +++ b/server/addons/hgexample/api/api/index/index.go @@ -0,0 +1,21 @@ +// Package index +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package index + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" +) + +// TestReq 测试 +type TestReq struct { + g.Meta `path:"/index/test" method:"get" tags:"功能案例" summary:"测试"` + sysin.IndexTestInp +} + +type TestRes struct { + *sysin.IndexTestModel +} diff --git a/server/addons/hgexample/api/home/index/index.go b/server/addons/hgexample/api/home/index/index.go new file mode 100644 index 0000000..7a44e68 --- /dev/null +++ b/server/addons/hgexample/api/home/index/index.go @@ -0,0 +1,21 @@ +// Package index +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package index + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" +) + +// TestReq 测试 +type TestReq struct { + g.Meta `path:"/index/test" method:"get" tags:"功能案例" summary:"测试首页"` + sysin.IndexTestInp +} + +type TestRes struct { + g.Meta `mime:"text/html" type:"string" example:"
"` +} diff --git a/server/addons/hgexample/api/websocket/index/index.go b/server/addons/hgexample/api/websocket/index/index.go new file mode 100644 index 0000000..764eaa8 --- /dev/null +++ b/server/addons/hgexample/api/websocket/index/index.go @@ -0,0 +1,21 @@ +// Package index +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package index + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" +) + +// TestReq 测试 +type TestReq struct { + g.Meta `path:"/index/test" method:"get" tags:"功能案例" summary:"测试"` + sysin.IndexTestInp +} + +type TestRes struct { + *sysin.IndexTestModel +} diff --git a/server/addons/hgexample/controller/admin/sys/comp.go b/server/addons/hgexample/controller/admin/sys/comp.go new file mode 100644 index 0000000..ba57d0b --- /dev/null +++ b/server/addons/hgexample/controller/admin/sys/comp.go @@ -0,0 +1,46 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "github.com/xuri/excelize/v2" + "hotgo/addons/hgexample/api/admin/comp" +) + +var ( + Comp = cComp{} +) + +type cComp struct{} + +// ImportExcel 导入Excel +func (c *cComp) ImportExcel(ctx context.Context, req *comp.ImportExcelReq) (res *comp.ImportExcelRes, err error) { + file, err := req.File.Open() + if err != nil { + return + } + defer file.Close() + + excel, err := excelize.OpenReader(file) + if err != nil { + return + } + defer excel.Close() + + res = new(comp.ImportExcelRes) + sheetList := excel.GetSheetList() + for _, sheet := range sheetList { + item := new(comp.ImportExcelSheet) + item.Sheet = sheet + item.Rows, err = excel.GetRows(sheet) + if err != nil { + return nil, err + } + res.Sheets = append(res.Sheets, item) + } + return +} diff --git a/server/addons/hgexample/controller/admin/sys/config.go b/server/addons/hgexample/controller/admin/sys/config.go new file mode 100644 index 0000000..ef40a69 --- /dev/null +++ b/server/addons/hgexample/controller/admin/sys/config.go @@ -0,0 +1,33 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/addons/hgexample/api/admin/config" + "hotgo/addons/hgexample/service" +) + +var ( + Config = cConfig{} +) + +type cConfig struct{} + +// GetConfig 获取指定分组的配置 +func (c *cConfig) GetConfig(ctx context.Context, req *config.GetReq) (res *config.GetRes, err error) { + data, err := service.SysConfig().GetConfigByGroup(ctx, &req.GetConfigInp) + + res = new(config.GetRes) + res.GetConfigModel = data + return +} + +// UpdateConfig 更新指定分组的配置 +func (c *cConfig) UpdateConfig(ctx context.Context, req *config.UpdateReq) (res *config.UpdateRes, err error) { + err = service.SysConfig().UpdateConfigByGroup(ctx, &req.UpdateConfigInp) + return +} diff --git a/server/addons/hgexample/controller/admin/sys/index.go b/server/addons/hgexample/controller/admin/sys/index.go new file mode 100644 index 0000000..b378b1d --- /dev/null +++ b/server/addons/hgexample/controller/admin/sys/index.go @@ -0,0 +1,30 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/addons/hgexample/api/admin/index" + "hotgo/addons/hgexample/service" +) + +var ( + Index = cIndex{} +) + +type cIndex struct{} + +// Test 测试 +func (c *cIndex) Test(ctx context.Context, req *index.TestReq) (res *index.TestRes, err error) { + data, err := service.SysIndex().Test(ctx, &req.IndexTestInp) + if err != nil { + return + } + + res = new(index.TestRes) + res.IndexTestModel = data + return +} diff --git a/server/addons/hgexample/controller/admin/sys/table.go b/server/addons/hgexample/controller/admin/sys/table.go new file mode 100644 index 0000000..03188cf --- /dev/null +++ b/server/addons/hgexample/controller/admin/sys/table.go @@ -0,0 +1,85 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/addons/hgexample/api/admin/table" + "hotgo/addons/hgexample/service" +) + +var ( + Table = cTable{} +) + +type cTable struct{} + +// List 查看列表 +func (c *cTable) List(ctx context.Context, req *table.ListReq) (res *table.ListRes, err error) { + list, totalCount, err := service.SysTable().List(ctx, &req.TableListInp) + if err != nil { + return + } + + res = new(table.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出列表 +func (c *cTable) Export(ctx context.Context, req *table.ExportReq) (res *table.ExportRes, err error) { + err = service.SysTable().Export(ctx, &req.TableListInp) + return +} + +// Edit 更新 +func (c *cTable) Edit(ctx context.Context, req *table.EditReq) (res *table.EditRes, err error) { + err = service.SysTable().Edit(ctx, &req.TableEditInp) + return +} + +// MaxSort 最大排序 +func (c *cTable) MaxSort(ctx context.Context, req *table.MaxSortReq) (res *table.MaxSortRes, err error) { + data, err := service.SysTable().MaxSort(ctx, &req.TableMaxSortInp) + if err != nil { + return + } + + res = new(table.MaxSortRes) + res.TableMaxSortModel = data + return +} + +// View 获取指定信息 +func (c *cTable) View(ctx context.Context, req *table.ViewReq) (res *table.ViewRes, err error) { + data, err := service.SysTable().View(ctx, &req.TableViewInp) + if err != nil { + return + } + + res = new(table.ViewRes) + res.TableViewModel = data + return +} + +// Delete 删除 +func (c *cTable) Delete(ctx context.Context, req *table.DeleteReq) (res *table.DeleteRes, err error) { + err = service.SysTable().Delete(ctx, &req.TableDeleteInp) + return +} + +// Status 更新状态 +func (c *cTable) Status(ctx context.Context, req *table.StatusReq) (res *table.StatusRes, err error) { + err = service.SysTable().Status(ctx, &req.TableStatusInp) + return +} + +// Switch 更新开关状态 +func (c *cTable) Switch(ctx context.Context, req *table.SwitchReq) (res *table.SwitchRes, err error) { + err = service.SysTable().Switch(ctx, &req.TableSwitchInp) + return +} diff --git a/server/addons/hgexample/controller/admin/sys/tenant_order.go b/server/addons/hgexample/controller/admin/sys/tenant_order.go new file mode 100644 index 0000000..95977a3 --- /dev/null +++ b/server/addons/hgexample/controller/admin/sys/tenant_order.go @@ -0,0 +1,67 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.13.1 +package sys + +import ( + "context" + "hotgo/addons/hgexample/api/admin/tenantorder" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/addons/hgexample/service" +) + +var ( + TenantOrder = cTenantOrder{} +) + +type cTenantOrder struct{} + +// List 查看多租户功能演示列表 +func (c *cTenantOrder) List(ctx context.Context, req *tenantorder.ListReq) (res *tenantorder.ListRes, err error) { + list, totalCount, err := service.SysTenantOrder().List(ctx, &req.TenantOrderListInp) + if err != nil { + return + } + + if list == nil { + list = []*sysin.TenantOrderListModel{} + } + + res = new(tenantorder.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出多租户功能演示列表 +func (c *cTenantOrder) Export(ctx context.Context, req *tenantorder.ExportReq) (res *tenantorder.ExportRes, err error) { + err = service.SysTenantOrder().Export(ctx, &req.TenantOrderListInp) + return +} + +// Edit 更新多租户功能演示 +func (c *cTenantOrder) Edit(ctx context.Context, req *tenantorder.EditReq) (res *tenantorder.EditRes, err error) { + err = service.SysTenantOrder().Edit(ctx, &req.TenantOrderEditInp) + return +} + +// View 获取指定多租户功能演示信息 +func (c *cTenantOrder) View(ctx context.Context, req *tenantorder.ViewReq) (res *tenantorder.ViewRes, err error) { + data, err := service.SysTenantOrder().View(ctx, &req.TenantOrderViewInp) + if err != nil { + return + } + + res = new(tenantorder.ViewRes) + res.TenantOrderViewModel = data + return +} + +// Delete 删除多租户功能演示 +func (c *cTenantOrder) Delete(ctx context.Context, req *tenantorder.DeleteReq) (res *tenantorder.DeleteRes, err error) { + err = service.SysTenantOrder().Delete(ctx, &req.TenantOrderDeleteInp) + return +} \ No newline at end of file diff --git a/server/addons/hgexample/controller/admin/sys/tree_table.go b/server/addons/hgexample/controller/admin/sys/tree_table.go new file mode 100644 index 0000000..0d2dd86 --- /dev/null +++ b/server/addons/hgexample/controller/admin/sys/tree_table.go @@ -0,0 +1,92 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/addons/hgexample/api/admin/treetable" + "hotgo/addons/hgexample/service" +) + +var ( + TreeTable = cTreeTable{} +) + +type cTreeTable struct{} + +// List 查看列表 +func (c *cTreeTable) List(ctx context.Context, req *treetable.ListReq) (res *treetable.ListRes, err error) { + list, totalCount, err := service.SysTreeTable().List(ctx, &req.TreeTableListInp) + if err != nil { + return + } + + res = new(treetable.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出列表 +func (c *cTreeTable) Export(ctx context.Context, req *treetable.ExportReq) (res *treetable.ExportRes, err error) { + err = service.SysTable().Export(ctx, &req.TableListInp) + return +} + +// Edit 更新 +func (c *cTreeTable) Edit(ctx context.Context, req *treetable.EditReq) (res *treetable.EditRes, err error) { + err = service.SysTreeTable().Edit(ctx, &req.TableEditInp) + return +} + +// MaxSort 最大排序 +func (c *cTreeTable) MaxSort(ctx context.Context, req *treetable.MaxSortReq) (res *treetable.MaxSortRes, err error) { + data, err := service.SysTable().MaxSort(ctx, &req.TableMaxSortInp) + if err != nil { + return + } + + res = new(treetable.MaxSortRes) + res.TableMaxSortModel = data + return +} + +// View 获取指定信息 +func (c *cTreeTable) View(ctx context.Context, req *treetable.ViewReq) (res *treetable.ViewRes, err error) { + data, err := service.SysTable().View(ctx, &req.TableViewInp) + if err != nil { + return + } + + res = new(treetable.ViewRes) + res.TableViewModel = data + return +} + +// Delete 删除 +func (c *cTreeTable) Delete(ctx context.Context, req *treetable.DeleteReq) (res *treetable.DeleteRes, err error) { + err = service.SysTreeTable().Delete(ctx, &req.TableDeleteInp) + return +} + +// Status 更新状态 +func (c *cTreeTable) Status(ctx context.Context, req *treetable.StatusReq) (res *treetable.StatusRes, err error) { + err = service.SysTable().Status(ctx, &req.TableStatusInp) + return +} + +// Switch 更新开关状态 +func (c *cTreeTable) Switch(ctx context.Context, req *treetable.SwitchReq) (res *treetable.SwitchRes, err error) { + err = service.SysTable().Switch(ctx, &req.TableSwitchInp) + return +} + +// Select 树形选项 +func (c *cTreeTable) Select(ctx context.Context, _ *treetable.SelectReq) (res *treetable.SelectRes, err error) { + res = new(treetable.SelectRes) + res.List, err = service.SysTreeTable().Select(ctx) + return +} diff --git a/server/addons/hgexample/controller/api/index.go b/server/addons/hgexample/controller/api/index.go new file mode 100644 index 0000000..c604f1d --- /dev/null +++ b/server/addons/hgexample/controller/api/index.go @@ -0,0 +1,30 @@ +// Package api +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package api + +import ( + "context" + "hotgo/addons/hgexample/api/api/index" + "hotgo/addons/hgexample/service" +) + +var ( + Index = cIndex{} +) + +type cIndex struct{} + +// Test 测试 +func (c *cIndex) Test(ctx context.Context, req *index.TestReq) (res *index.TestRes, err error) { + data, err := service.SysIndex().Test(ctx, &req.IndexTestInp) + if err != nil { + return + } + + res = new(index.TestRes) + res.IndexTestModel = data + return +} diff --git a/server/addons/hgexample/controller/home/index.go b/server/addons/hgexample/controller/home/index.go new file mode 100644 index 0000000..668fc74 --- /dev/null +++ b/server/addons/hgexample/controller/home/index.go @@ -0,0 +1,34 @@ +// Package home +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package home + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/api/home/index" + "hotgo/addons/hgexample/service" + "hotgo/internal/model" + isc "hotgo/internal/service" +) + +// Index 基础 +var Index = cIndex{} + +type cIndex struct{} + +func (a *cIndex) Index(ctx context.Context, req *index.TestReq) (res *index.TestRes, err error) { + data, err := service.SysIndex().Test(ctx, &req.IndexTestInp) + if err != nil { + return + } + + isc.View().RenderTpl(ctx, "home/index.html", model.View{Data: g.Map{ + "name": data.Name, + "module": data.Module, + "time": data.Time, + }}) + return +} diff --git a/server/addons/hgexample/controller/websocket/handler/index.go b/server/addons/hgexample/controller/websocket/handler/index.go new file mode 100644 index 0000000..0cc74ab --- /dev/null +++ b/server/addons/hgexample/controller/websocket/handler/index.go @@ -0,0 +1,25 @@ +// Package handler +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package handler + +import ( + "github.com/gogf/gf/v2/encoding/gjson" + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/websocket" +) + +var ( + Index = cIndex{} +) + +type cIndex struct{} + +// TestMessage 测试消息 +func (c *cIndex) TestMessage(client *websocket.Client, req *websocket.WRequest) { + g.Log().Infof(client.Context(), "收到客户端测试消息:%v", gjson.New(req).String()) + // 将收到的消息原样发送给客户端 + websocket.SendSuccess(client, req.Event, req.Data) +} diff --git a/server/addons/hgexample/controller/websocket/index.go b/server/addons/hgexample/controller/websocket/index.go new file mode 100644 index 0000000..37b9bbf --- /dev/null +++ b/server/addons/hgexample/controller/websocket/index.go @@ -0,0 +1,30 @@ +// Package websocket +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package websocket + +import ( + "context" + "hotgo/addons/hgexample/api/websocket/index" + "hotgo/addons/hgexample/service" +) + +var ( + Index = cIndex{} +) + +type cIndex struct{} + +// Test 测试 +func (c *cIndex) Test(ctx context.Context, req *index.TestReq) (res *index.TestRes, err error) { + data, err := service.SysIndex().Test(ctx, &req.IndexTestInp) + if err != nil { + return + } + + res = new(index.TestRes) + res.IndexTestModel = data + return +} diff --git a/server/addons/hgexample/crons/crons.go b/server/addons/hgexample/crons/crons.go new file mode 100644 index 0000000..e20bf6c --- /dev/null +++ b/server/addons/hgexample/crons/crons.go @@ -0,0 +1,9 @@ +// Package crons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package crons + +// 定时任务. +// 插件中的定时任务可以统一在这里注册和处理 diff --git a/server/addons/hgexample/global/global.go b/server/addons/hgexample/global/global.go new file mode 100644 index 0000000..f549f88 --- /dev/null +++ b/server/addons/hgexample/global/global.go @@ -0,0 +1,12 @@ +// Package global +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package global + +import "hotgo/internal/library/addons" + +var ( + skeleton *addons.Skeleton // 插件架子 +) diff --git a/server/addons/hgexample/global/init.go b/server/addons/hgexample/global/init.go new file mode 100644 index 0000000..9db6de9 --- /dev/null +++ b/server/addons/hgexample/global/init.go @@ -0,0 +1,22 @@ +// Package global +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package global + +import ( + "context" + "hotgo/internal/library/addons" +) + +func Init(ctx context.Context, sk *addons.Skeleton) { + skeleton = sk +} + +func GetSkeleton() *addons.Skeleton { + if skeleton == nil { + panic("addon skeleton not initialized.") + } + return skeleton +} diff --git a/server/addons/hgexample/logic/.gitkeep b/server/addons/hgexample/logic/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/server/addons/hgexample/logic/logic.go b/server/addons/hgexample/logic/logic.go new file mode 100644 index 0000000..bd978f2 --- /dev/null +++ b/server/addons/hgexample/logic/logic.go @@ -0,0 +1,9 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package logic + +import ( + _ "hotgo/addons/hgexample/logic/sys" +) diff --git a/server/addons/hgexample/logic/sys/config.go b/server/addons/hgexample/logic/sys/config.go new file mode 100644 index 0000000..73620b2 --- /dev/null +++ b/server/addons/hgexample/logic/sys/config.go @@ -0,0 +1,59 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "github.com/gogf/gf/v2/util/gconv" + "hotgo/addons/hgexample/global" + "hotgo/addons/hgexample/model" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/addons/hgexample/service" + isc "hotgo/internal/service" +) + +type sSysConfig struct{} + +func NewSysConfig() *sSysConfig { + return &sSysConfig{} +} + +func init() { + service.RegisterSysConfig(NewSysConfig()) +} + +// GetBasic 获取基础配置 +func (s *sSysConfig) GetBasic(ctx context.Context) (conf *model.BasicConfig, err error) { + var in sysin.GetConfigInp + in.GetAddonsConfigInp.AddonName = global.GetSkeleton().Name + in.GetAddonsConfigInp.Group = "basic" + models, err := isc.SysAddonsConfig().GetConfigByGroup(ctx, &in.GetAddonsConfigInp) + if err != nil { + return + } + + err = gconv.Struct(models.List, &conf) + return +} + +// GetConfigByGroup 获取指定分组配置 +func (s *sSysConfig) GetConfigByGroup(ctx context.Context, in *sysin.GetConfigInp) (res *sysin.GetConfigModel, err error) { + in.GetAddonsConfigInp.AddonName = global.GetSkeleton().Name + models, err := isc.SysAddonsConfig().GetConfigByGroup(ctx, &in.GetAddonsConfigInp) + if err != nil { + return + } + + res = new(sysin.GetConfigModel) + res.List = models.List + return +} + +// UpdateConfigByGroup 更新指定分组的配置 +func (s *sSysConfig) UpdateConfigByGroup(ctx context.Context, in *sysin.UpdateConfigInp) error { + in.UpdateAddonsConfigInp.AddonName = global.GetSkeleton().Name + return isc.SysAddonsConfig().UpdateConfigByGroup(ctx, &in.UpdateAddonsConfigInp) +} diff --git a/server/addons/hgexample/logic/sys/index.go b/server/addons/hgexample/logic/sys/index.go new file mode 100644 index 0000000..d3e8ccd --- /dev/null +++ b/server/addons/hgexample/logic/sys/index.go @@ -0,0 +1,35 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "fmt" + "github.com/gogf/gf/v2/os/gtime" + "hotgo/addons/hgexample/global" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/addons/hgexample/service" + "hotgo/internal/library/contexts" +) + +type sSysIndex struct{} + +func NewSysIndex() *sSysIndex { + return &sSysIndex{} +} + +func init() { + service.RegisterSysIndex(NewSysIndex()) +} + +// Test 测试 +func (s *sSysIndex) Test(ctx context.Context, in *sysin.IndexTestInp) (res *sysin.IndexTestModel, err error) { + res = new(sysin.IndexTestModel) + res.Name = in.Name + res.Module = fmt.Sprintf("当前插件模块是:%s,当前应用模块是:%s", global.GetSkeleton().Name, contexts.Get(ctx).Module) + res.Time = gtime.Now() + return +} diff --git a/server/addons/hgexample/logic/sys/table.go b/server/addons/hgexample/logic/sys/table.go new file mode 100644 index 0000000..9c828bb --- /dev/null +++ b/server/addons/hgexample/logic/sys/table.go @@ -0,0 +1,233 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "fmt" + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gctx" + "github.com/gogf/gf/v2/util/gconv" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/addons/hgexample/service" + "hotgo/internal/dao" + "hotgo/internal/library/contexts" + "hotgo/internal/library/hgorm" + "hotgo/internal/library/hgorm/handler" + "hotgo/internal/model/input/form" + "hotgo/utility/convert" + "hotgo/utility/excel" + "hotgo/utility/validate" +) + +type sSysTable struct{} + +func NewSysTable() *sSysTable { + return &sSysTable{} +} + +func init() { + service.RegisterSysTable(NewSysTable()) +} + +// Model Orm模型 +func (s *sSysTable) Model(ctx context.Context, option ...*handler.Option) *gdb.Model { + return handler.Model(dao.AddonHgexampleTable.Ctx(ctx), option...) +} + +// List 获取列表 +func (s *sSysTable) List(ctx context.Context, in *sysin.TableListInp) (list []*sysin.TableListModel, totalCount int, err error) { + mod := s.Model(ctx) + cols := dao.AddonHgexampleTable.Columns() + + if in.Title != "" { + mod = mod.WhereLike(cols.Title, "%"+in.Title+"%") + } + + if in.Content != "" { + mod = mod.WhereLike(cols.Content, "%"+in.Content+"%") + } + + if in.Status > 0 { + mod = mod.Where(cols.Status, in.Status) + } + + if in.Switch > 0 { + mod = mod.Where(cols.Switch, in.Switch) + } + + if len(in.Price) > 0 { + if in.Price[0] > 0 && in.Price[1] > 0 { + mod = mod.WhereBetween(cols.Price, in.Price[0], in.Price[1]) + } else if in.Price[0] > 0 && in.Price[1] == 0 { + mod = mod.WhereGTE(cols.Price, in.Price[0]) + } else if in.Price[0] == 0 && in.Price[1] > 0 { + mod = mod.WhereLTE(cols.Price, in.Price[1]) + } + } + + if in.ActivityAt != nil { + mod = mod.Where(cols.ActivityAt, in.ActivityAt) + } + + if len(in.CreatedAt) == 2 { + mod = mod.WhereBetween(cols.CreatedAt, in.CreatedAt[0], in.CreatedAt[1]) + } + + if !in.Flag.IsNil() { + mod = mod.Where(fmt.Sprintf(`JSON_CONTAINS(%s,'%v')`, cols.Flag, in.Flag)) + } + + if !in.Hobby.IsNil() { + mod = mod.Where(fmt.Sprintf(`JSON_CONTAINS(%s,'%v')`, cols.Hobby, in.Hobby)) + } + + totalCount, err = mod.Clone().Count() + if err != nil { + err = gerror.Wrap(err, "获取表格数据行失败,请稍后重试!") + return + } + + if totalCount == 0 { + return + } + + // .OrderAsc(cols.Sort).OrderDesc(cols.Id) + if err = mod.Fields(sysin.TableListModel{}).Page(in.Page, in.PerPage).Handler(handler.Sorter(in)).Scan(&list); err != nil { + err = gerror.Wrap(err, "获取表格列表失败,请稍后重试!") + return + } + return +} + +// Export 导出 +func (s *sSysTable) Export(ctx context.Context, in *sysin.TableListInp) (err error) { + list, totalCount, err := s.List(ctx, in) + if err != nil { + return + } + + // 字段的排序是依据tags的字段顺序,如果你不想使用默认的排序方式,可以直接定义 tags = []string{"字段名称", "字段名称2", ...} + tags, err := convert.GetEntityDescTags(sysin.TableExportModel{}) + if err != nil { + return + } + + var ( + fileName = "表格例子导出-" + gctx.CtxId(ctx) + sheetName = fmt.Sprintf("索引条件共%v行,共%v页,当前导出是第%v页,本页共%v行", totalCount, form.CalPageCount(totalCount, in.PerPage), in.Page, len(list)) + exports []sysin.TableExportModel + ) + + if err = gconv.Scan(list, &exports); err != nil { + return + } + + if err = excel.ExportByStructs(ctx, tags, exports, fileName, sheetName); err != nil { + return + } + return +} + +// Edit 修改/新增 +func (s *sSysTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err error) { + cols := dao.AddonHgexampleTable.Columns() + if err = hgorm.IsUnique(ctx, &dao.AddonHgexampleTable, g.Map{cols.Qq: in.Qq}, "QQ号码已存在,请换一个", in.Id); err != nil { + return + } + + // 修改 + if in.Id > 0 { + in.UpdatedBy = contexts.GetUserId(ctx) + if _, err = s.Model(ctx).WherePri(in.Id).Data(in).Update(); err != nil { + err = gerror.Wrap(err, "修改表格失败,请稍后重试!") + return + } + return + } + + // 新增 + in.CreatedBy = contexts.GetUserId(ctx) + if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).OmitEmptyData().Insert(); err != nil { + err = gerror.Wrap(err, "新增表格失败,请稍后重试!") + return + } + return +} + +// Delete 删除 +func (s *sSysTable) Delete(ctx context.Context, in *sysin.TableDeleteInp) (err error) { + if _, err = s.Model(ctx).WherePri(in.Id).Delete(); err != nil { + err = gerror.Wrap(err, "删除表格失败,请稍后重试!") + return + } + return +} + +// Status 更新状态 +func (s *sSysTable) Status(ctx context.Context, in *sysin.TableStatusInp) (err error) { + update := g.Map{ + dao.AddonHgexampleTable.Columns().Status: in.Status, + dao.AddonHgexampleTable.Columns().UpdatedBy: contexts.GetUserId(ctx), + } + + if _, err = s.Model(ctx).WherePri(in.Id).Data(update).Update(); err != nil { + err = gerror.Wrap(err, "更新表格状态失败,请稍后重试!") + return + } + return +} + +// Switch 更新开关状态 +func (s *sSysTable) Switch(ctx context.Context, in *sysin.TableSwitchInp) (err error) { + var fields = []string{ + dao.AddonHgexampleTable.Columns().Switch, + // ... + } + + if !validate.InSlice(fields, in.Key) { + err = gerror.New("开关键名不在白名单") + return + } + + update := g.Map{ + in.Key: in.Value, + dao.AddonHgexampleTable.Columns().UpdatedBy: contexts.GetUserId(ctx), + } + + if _, err = s.Model(ctx).Where(dao.AddonHgexampleTable.Columns().Id, in.Id).Data(update).Update(); err != nil { + err = gerror.Wrap(err, "更新表格开关失败,请稍后重试!") + return + } + return +} + +// MaxSort 最大排序 +func (s *sSysTable) MaxSort(ctx context.Context, in *sysin.TableMaxSortInp) (res *sysin.TableMaxSortModel, err error) { + dx := dao.AddonHgexampleTable + if err = dx.Ctx(ctx).Fields(dx.Columns().Sort).OrderDesc(dx.Columns().Sort).Scan(&res); err != nil { + err = gerror.Wrap(err, "获取表格最大排序,请稍后重试!") + return + } + + if res == nil { + res = new(sysin.TableMaxSortModel) + } + + res.Sort = form.DefaultMaxSort(res.Sort) + return +} + +// View 获取指定信息 +func (s *sSysTable) View(ctx context.Context, in *sysin.TableViewInp) (res *sysin.TableViewModel, err error) { + if err = s.Model(ctx).WherePri(in.Id).Scan(&res); err != nil { + err = gerror.Wrap(err, "获取生成演示信息,请稍后重试!") + return + } + return +} diff --git a/server/addons/hgexample/logic/sys/tenant_order.go b/server/addons/hgexample/logic/sys/tenant_order.go new file mode 100644 index 0000000..ac8094d --- /dev/null +++ b/server/addons/hgexample/logic/sys/tenant_order.go @@ -0,0 +1,174 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.13.1 +package sys + +import ( + "context" + "fmt" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/addons/hgexample/service" + "hotgo/internal/dao" + "hotgo/internal/library/hgorm/handler" + "hotgo/internal/library/hgorm/hook" + "hotgo/internal/model/input/form" + "hotgo/utility/convert" + "hotgo/utility/excel" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gctx" + "github.com/gogf/gf/v2/util/gconv" +) + +type sSysTenantOrder struct{} + +func NewSysTenantOrder() *sSysTenantOrder { + return &sSysTenantOrder{} +} + +func init() { + service.RegisterSysTenantOrder(NewSysTenantOrder()) +} + +// Model 多租户功能演示ORM模型 +func (s *sSysTenantOrder) Model(ctx context.Context, option ...*handler.Option) *gdb.Model { + if len(option) == 0 { + // 过滤多租户数据权限 + option = append(option, &handler.Option{ + FilterTenant: true, + //FilterAuth: true, // 如果还需要维护created_by、member_id等部门数据权限范围可放开注释 + }) + } + return handler.Model(dao.AddonHgexampleTenantOrder.Ctx(ctx), option...) +} + +// List 获取多租户功能演示列表 +func (s *sSysTenantOrder) List(ctx context.Context, in *sysin.TenantOrderListInp) (list []*sysin.TenantOrderListModel, totalCount int, err error) { + mod := s.Model(ctx) + + // 字段过滤 + mod = mod.Fields(sysin.TenantOrderListModel{}) + + // 查询主键 + if in.Id > 0 { + mod = mod.Where(dao.AddonHgexampleTenantOrder.Columns().Id, in.Id) + } + + // 查询租户ID + if in.TenantId > 0 { + mod = mod.Where(dao.AddonHgexampleTenantOrder.Columns().TenantId, in.TenantId) + } + + // 查询商户ID + if in.MerchantId > 0 { + mod = mod.Where(dao.AddonHgexampleTenantOrder.Columns().MerchantId, in.MerchantId) + } + + // 查询用户ID + if in.UserId > 0 { + mod = mod.Where(dao.AddonHgexampleTenantOrder.Columns().UserId, in.UserId) + } + + // 查询关联订单号 + if in.OrderSn != "" { + mod = mod.Where(dao.AddonHgexampleTenantOrder.Columns().OrderSn, in.OrderSn) + } + + // 查询支付状态 + if in.Status > 0 { + mod = mod.Where(dao.AddonHgexampleTenantOrder.Columns().Status, in.Status) + } + + // 查询创建时间 + if len(in.CreatedAt) == 2 { + mod = mod.WhereBetween(dao.AddonHgexampleTenantOrder.Columns().CreatedAt, in.CreatedAt[0], in.CreatedAt[1]) + } + + // 分页 + mod = mod.Page(in.Page, in.PerPage) + + // 排序 + mod = mod.OrderDesc(dao.AddonHgexampleTenantOrder.Columns().Id) + + // 查询数据 + if err = mod.ScanAndCount(&list, &totalCount, false); err != nil { + err = gerror.Wrap(err, "获取多租户功能演示列表失败,请稍后重试!") + return + } + return +} + +// Export 导出多租户功能演示 +func (s *sSysTenantOrder) Export(ctx context.Context, in *sysin.TenantOrderListInp) (err error) { + list, totalCount, err := s.List(ctx, in) + if err != nil { + return + } + + // 字段的排序是依据tags的字段顺序,如果你不想使用默认的排序方式,可以直接定义 tags = []string{"字段名称", "字段名称2", ...} + tags, err := convert.GetEntityDescTags(sysin.TenantOrderExportModel{}) + if err != nil { + return + } + + var ( + fileName = "导出多租户功能演示-" + gctx.CtxId(ctx) + sheetName = fmt.Sprintf("索引条件共%v行,共%v页,当前导出是第%v页,本页共%v行", totalCount, form.CalPageCount(totalCount, in.PerPage), in.Page, len(list)) + exports []sysin.TenantOrderExportModel + ) + + if err = gconv.Scan(list, &exports); err != nil { + return + } + + err = excel.ExportByStructs(ctx, tags, exports, fileName, sheetName) + return +} + +// Edit 修改/新增多租户功能演示 +func (s *sSysTenantOrder) Edit(ctx context.Context, in *sysin.TenantOrderEditInp) (err error) { + return g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) { + // 修改 + if in.Id > 0 { + if _, err = s.Model(ctx). + Fields(sysin.TenantOrderUpdateFields{}). + WherePri(in.Id).Data(in). + Hook(hook.SaveTenant). // 自动维护租户关系更新 + Update(); err != nil { + } + return + } + + // 新增 + if _, err = dao.AddonHgexampleTenantOrder.Ctx(ctx). + Fields(sysin.TenantOrderInsertFields{}). + Hook(hook.SaveTenant). // 自动维护租户关系更新 + Data(in). + Insert(); err != nil { + } + return + }) +} + +// Delete 删除多租户功能演示 +func (s *sSysTenantOrder) Delete(ctx context.Context, in *sysin.TenantOrderDeleteInp) (err error) { + if _, err = s.Model(ctx).WherePri(in.Id).Delete(); err != nil { + err = gerror.Wrap(err, "删除多租户功能演示失败,请稍后重试!") + return + } + return +} + +// View 获取多租户功能演示指定信息 +func (s *sSysTenantOrder) View(ctx context.Context, in *sysin.TenantOrderViewInp) (res *sysin.TenantOrderViewModel, err error) { + if err = s.Model(ctx).WherePri(in.Id).Scan(&res); err != nil { + err = gerror.Wrap(err, "获取多租户功能演示信息,请稍后重试!") + return + } + return +} diff --git a/server/addons/hgexample/logic/sys/tree_table.go b/server/addons/hgexample/logic/sys/tree_table.go new file mode 100644 index 0000000..2f09057 --- /dev/null +++ b/server/addons/hgexample/logic/sys/tree_table.go @@ -0,0 +1,186 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "fmt" + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/addons/hgexample/service" + "hotgo/internal/consts" + "hotgo/internal/dao" + "hotgo/internal/library/contexts" + "hotgo/internal/library/hgorm" + "hotgo/internal/library/hgorm/handler" + "hotgo/internal/model/entity" +) + +type sSysTreeTable struct{} + +func NewSysTreeTable() *sSysTreeTable { + return &sSysTreeTable{} +} + +func init() { + service.RegisterSysTreeTable(NewSysTreeTable()) +} + +// Model Orm模型 +func (s *sSysTreeTable) Model(ctx context.Context, option ...*handler.Option) *gdb.Model { + return handler.Model(dao.AddonHgexampleTable.Ctx(ctx), option...) +} + +// List 获取列表 +func (s *sSysTreeTable) List(ctx context.Context, in *sysin.TreeTableListInp) (list []*sysin.TreeTableListModel, totalCount int, err error) { + mod := s.Model(ctx) + cols := dao.AddonHgexampleTable.Columns() + + if in.Title != "" { + mod = mod.WhereLike(cols.Title, "%"+in.Title+"%") + } + + if in.Content != "" { + mod = mod.WhereLike(cols.Content, "%"+in.Content+"%") + } + + if in.Status > 0 { + mod = mod.Where(cols.Status, in.Status) + } + + if in.Switch > 0 { + mod = mod.Where(cols.Switch, in.Switch) + } + + if in.Pid > 0 { + mod = mod.Where(cols.Pid, in.Pid) + } + + if len(in.Price) > 0 { + if in.Price[0] > 0 && in.Price[1] > 0 { + mod = mod.WhereBetween(cols.Price, in.Price[0], in.Price[1]) + } else if in.Price[0] > 0 && in.Price[1] == 0 { + mod = mod.WhereGTE(cols.Price, in.Price[0]) + } else if in.Price[0] == 0 && in.Price[1] > 0 { + mod = mod.WhereLTE(cols.Price, in.Price[1]) + } + } + + if in.ActivityAt != nil { + mod = mod.Where(cols.ActivityAt, in.ActivityAt) + } + + if len(in.CreatedAt) == 2 { + mod = mod.WhereBetween(cols.CreatedAt, in.CreatedAt[0], in.CreatedAt[1]) + } + + if !in.Flag.IsNil() { + mod = mod.Where(fmt.Sprintf(`JSON_CONTAINS(%s,'%v')`, cols.Flag, in.Flag)) + } + + if !in.Hobby.IsNil() { + mod = mod.Where(fmt.Sprintf(`JSON_CONTAINS(%s,'%v')`, cols.Hobby, in.Hobby)) + } + + totalCount, err = mod.Clone().Count() + if err != nil { + err = gerror.Wrap(err, "获取表格数据行失败,请稍后重试!") + return + } + + if totalCount == 0 { + return + } + + if err = mod.Fields(sysin.TableListModel{}).Page(in.Page, in.PerPage).Handler(handler.Sorter(in)).Scan(&list); err != nil { + err = gerror.Wrap(err, "获取表格列表失败,请稍后重试!") + return + } + return +} + +// Edit 修改/新增 +func (s *sSysTreeTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err error) { + cols := dao.AddonHgexampleTable.Columns() + if err = hgorm.IsUnique(ctx, &dao.AddonHgexampleTable, g.Map{cols.Qq: in.Qq}, "QQ号码已存在,请换一个", in.Id); err != nil { + return + } + + return g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) { + in.Pid, in.Level, in.Tree, err = hgorm.AutoUpdateTree(ctx, &dao.AddonHgexampleTable, in.Id, in.Pid) + if err != nil { + return err + } + + if in.Id > 0 { + in.UpdatedBy = contexts.GetUserId(ctx) + if _, err = s.Model(ctx).WherePri(in.Id).Data(in).Update(); err != nil { + err = gerror.Wrap(err, "修改表格失败,请稍后重试!") + return err + } + } else { + in.CreatedBy = contexts.GetUserId(ctx) + if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).OmitEmptyData().Insert(); err != nil { + err = gerror.Wrap(err, "新增表格失败,请稍后重试!") + return err + } + } + return + }) +} + +// Delete 删除 +func (s *sSysTreeTable) Delete(ctx context.Context, in *sysin.TableDeleteInp) (err error) { + count, err := dao.AdminMenu.Ctx(ctx).Where("pid", in.Id).Count() + if err != nil { + err = gerror.Wrap(err, consts.ErrorORM) + return err + } + if count > 0 { + return gerror.New("请先删除该表格下的所有下级!") + } + + if _, err = s.Model(ctx).WherePri(in.Id).Delete(); err != nil { + err = gerror.Wrap(err, "删除表格失败,请稍后重试!") + return + } + return +} + +// Select 关系树选项列表 +func (s *sSysTreeTable) Select(ctx context.Context) (list []*sysin.TableTree, err error) { + var models []*entity.AddonHgexampleTable + if err = dao.AddonHgexampleTable.Ctx(ctx).Order("pid asc,id asc,sort asc").Scan(&models); err != nil { + err = gerror.Wrap(err, "获取关系树选项列表失败!") + return + } + + list = s.treeList(0, models) + return +} + +// treeList 树状列表 +func (s *sSysTreeTable) treeList(pid int64, nodes []*entity.AddonHgexampleTable) (list []*sysin.TableTree) { + list = make([]*sysin.TableTree, 0) + for _, v := range nodes { + if v.Pid == pid { + item := new(sysin.TableTree) + item.AddonHgexampleTable = *v + item.Label = v.Title + item.Value = v.Id + item.Key = v.Id + + child := s.treeList(v.Id, nodes) + if len(child) > 0 { + item.Children = child + } + list = append(list, item) + } + } + return +} diff --git a/server/addons/hgexample/main.go b/server/addons/hgexample/main.go new file mode 100644 index 0000000..2cccd3a --- /dev/null +++ b/server/addons/hgexample/main.go @@ -0,0 +1,97 @@ +// Package hgexample +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package hgexample + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/os/gctx" + _ "hotgo/addons/hgexample/crons" + "hotgo/addons/hgexample/global" + _ "hotgo/addons/hgexample/logic" + _ "hotgo/addons/hgexample/queues" + "hotgo/addons/hgexample/router" + "hotgo/internal/library/addons" + "hotgo/internal/service" + "sync" +) + +type module struct { + skeleton *addons.Skeleton + ctx context.Context + sync.Mutex +} + +func init() { + newModule() +} + +func newModule() { + m := &module{ + skeleton: &addons.Skeleton{ + Label: "功能案例", + Name: "hgexample", + Group: 1, + Logo: "", + Brief: "系统的一些功能案例", + Description: "系统自带的功能使用示例及其说明,包含一些简单的交互", + Author: "孟帅", + Version: "v1.0.0", // 当该版本号高于已安装的版本号时,会提示可以更新 + }, + ctx: gctx.New(), + } + + addons.RegisterModule(m) +} + +// Start 启动模块 +func (m *module) Start(option *addons.Option) (err error) { + // 初始化模块 + global.Init(m.ctx, m.skeleton) + + // 注册插件路由 + option.Server.Group("/", func(group *ghttp.RouterGroup) { + group.Middleware(service.Middleware().Addon) + router.Admin(m.ctx, group) + router.Api(m.ctx, group) + router.Home(m.ctx, group) + router.WebSocket(m.ctx, group) + }) + return +} + +// Stop 停止模块 +func (m *module) Stop() (err error) { + return +} + +// Ctx 上下文 +func (m *module) Ctx() context.Context { + return m.ctx +} + +// GetSkeleton 获取模块 +func (m *module) GetSkeleton() *addons.Skeleton { + return m.skeleton +} + +// Install 安装模块 +func (m *module) Install(ctx context.Context) (err error) { + // ... + return +} + +// Upgrade 更新模块 +func (m *module) Upgrade(ctx context.Context) (err error) { + // ... + return +} + +// UnInstall 卸载模块 +func (m *module) UnInstall(ctx context.Context) (err error) { + // ... + return +} diff --git a/server/addons/hgexample/model/config.go b/server/addons/hgexample/model/config.go new file mode 100644 index 0000000..7496b4b --- /dev/null +++ b/server/addons/hgexample/model/config.go @@ -0,0 +1,11 @@ +// Package model +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package model + +// BasicConfig 基础配置 +type BasicConfig struct { + Test string `json:"basicTest"` +} diff --git a/server/addons/hgexample/model/input/sysin/config.go b/server/addons/hgexample/model/input/sysin/config.go new file mode 100644 index 0000000..05c4fc1 --- /dev/null +++ b/server/addons/hgexample/model/input/sysin/config.go @@ -0,0 +1,24 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sysin + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/sysin" +) + +// UpdateConfigInp 更新指定配置 +type UpdateConfigInp struct { + sysin.UpdateAddonsConfigInp +} + +type GetConfigInp struct { + sysin.GetAddonsConfigInp +} + +type GetConfigModel struct { + List g.Map `json:"list"` +} diff --git a/server/addons/hgexample/model/input/sysin/index.go b/server/addons/hgexample/model/input/sysin/index.go new file mode 100644 index 0000000..8e19ad5 --- /dev/null +++ b/server/addons/hgexample/model/input/sysin/index.go @@ -0,0 +1,27 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// +package sysin + +import ( + "context" + "github.com/gogf/gf/v2/os/gtime" +) + +// IndexTestInp 测试 +type IndexTestInp struct { + Name string `json:"name" d:"HotGo" dc:"名称"` +} + +func (in *IndexTestInp) Filter(ctx context.Context) (err error) { + return +} + +type IndexTestModel struct { + Name string `json:"name" dc:"名称"` + Module string `json:"module" dc:"当前插件模块"` + Time *gtime.Time `json:"time" dc:"当前时间"` +} diff --git a/server/addons/hgexample/model/input/sysin/table.go b/server/addons/hgexample/model/input/sysin/table.go new file mode 100644 index 0000000..e8d9f58 --- /dev/null +++ b/server/addons/hgexample/model/input/sysin/table.go @@ -0,0 +1,180 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sysin + +import ( + "context" + "errors" + "github.com/gogf/gf/v2/encoding/gjson" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" + "hotgo/internal/consts" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/form" + "hotgo/utility/validate" +) + +// TableEditInp 修改/新增 +type TableEditInp struct { + entity.AddonHgexampleTable +} + +type TableEditModel struct{} + +func (in *TableEditInp) Filter(ctx context.Context) (err error) { + if in.Map.IsNil() { + in.Map = gjson.New(consts.NilJsonToString) + } + if in.Flag.IsNil() { + in.Flag = gjson.New(consts.NilJsonToString) + } + if in.Images.IsNil() { + in.Images = gjson.New(consts.NilJsonToString) + } + if in.Attachfiles.IsNil() { + in.Attachfiles = gjson.New(consts.NilJsonToString) + } + if in.Hobby.IsNil() { + in.Hobby = gjson.New(consts.NilJsonToString) + } + + if in.Title == "" { + return errors.New("标题不能为空") + } + + if in.Email != "" && !validate.IsEmail(in.Email) { + return errors.New("邮箱格式不正确") + } + + if err := g.Validator().Rules("float|between:0,5").Messages("请输入一个浮点数|推荐星只能是0~5星").Data(in.Star).Run(ctx); err != nil { + return err.Current() + } + return +} + +// TableDeleteInp 删除类型 +type TableDeleteInp struct { + Id interface{} `json:"id" v:"required#表格ID不能为空" dc:"表格ID"` +} + +type TableDeleteModel struct{} + +// TableViewInp 获取信息 +type TableViewInp struct { + Id int64 `json:"id" v:"required#表格ID不能为空" dc:"表格ID"` +} + +type TableViewModel struct { + entity.AddonHgexampleTable +} + +// TableListInp 获取列表 +type TableListInp struct { + form.PageReq + form.Sorters + Id int64 `json:"id" description:""` + Flag *gjson.Json `json:"flag" description:"标签"` + Title string `json:"title" description:"标题"` + Content string `json:"content" description:"内容"` + Price []float64 `json:"price" description:"价格"` + ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"` + Switch int `json:"switch" description:"开关"` + Hobby *gjson.Json `json:"hobby" description:"爱好"` + Status int `json:"status" description:"状态"` + CreatedAt []*gtime.Time `json:"createdAt" description:"创建时间"` +} + +type TableListModel struct { + entity.AddonHgexampleTable + TableCategoryName string `json:"TableCategoryName" description:"分类名称"` + TableCategoryDescription string `json:"TableCategoryDescription" description:"分类描述"` + TableCategoryRemark string `json:"TableCategoryRemark" description:"分类备注"` + SysProvincesTitle string `json:"sysProvincesTitle" description:""` +} + +func (in *TableListInp) Filter(ctx context.Context) (err error) { + if !in.Flag.IsNil() { + in.Flag = gjson.New(in.Flag.Var().Ints()) + } + if !in.Hobby.IsNil() { + in.Hobby = gjson.New(in.Hobby.Var().Ints()) + } + return +} + +type TableExportModel struct { + Id int64 `json:"id" description:""` + CategoryId int64 `json:"categoryId" description:"分类ID"` + Flag *gjson.Json `json:"flag" description:"标签"` + Title string `json:"title" description:"标题"` + Star float64 `json:"star" description:"推荐星"` + Price float64 `json:"price" description:"价格"` + Views int64 `json:"views" description:"浏览次数"` + ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"` + StartAt *gtime.Time `json:"startAt" description:"开启时间"` + EndAt *gtime.Time `json:"endAt" description:"结束时间"` + Switch int `json:"switch" description:"开关"` + Sort int `json:"sort" description:"排序"` + Avatar string `json:"avatar" description:"头像"` + Sex int `json:"sex" description:"性别"` + Qq string `json:"qq" description:"qq"` + Email string `json:"email" description:"邮箱"` + Mobile string `json:"mobile" description:"手机号码"` + Hobby *gjson.Json `json:"hobby" description:"爱好"` + Channel int `json:"channel" description:"渠道"` + Pid int64 `json:"pid" description:"上级ID"` + Level int `json:"level" description:"树等级"` + Tree string `json:"tree" description:"关系树"` + Remark string `json:"remark" description:"备注"` + Status int `json:"status" description:"状态"` + CreatedBy int64 `json:"createdBy" description:"创建者"` + UpdatedBy int64 `json:"updatedBy" description:"更新者"` + CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"` + UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"` + DeletedAt *gtime.Time `json:"deletedAt" description:"删除时间"` +} + +// TableMaxSortInp 最大排序 +type TableMaxSortInp struct{} + +type TableMaxSortModel struct { + Sort int `json:"sort" description:"排序"` +} + +// TableStatusInp 更新状态 +type TableStatusInp struct { + Id int64 `json:"id" v:"required#表格ID不能为空" dc:"表格ID"` + Status int `json:"status" dc:"状态"` +} + +func (in *TableStatusInp) Filter(ctx context.Context) (err error) { + if in.Id <= 0 { + err = gerror.New("ID不能为空") + return + } + + if in.Status <= 0 { + err = gerror.New("状态不能为空") + return + } + + if !validate.InSlice(consts.StatusSlice, in.Status) { + err = gerror.New("状态不正确") + return + } + return +} + +type TableStatusModel struct{} + +// TableSwitchInp 更新开关状态 +type TableSwitchInp struct { + form.SwitchReq + Id int64 `json:"id" v:"required#表格ID不能为空" dc:"表格ID"` +} + +type TableSwitchModel struct{} diff --git a/server/addons/hgexample/model/input/sysin/tenant_order.go b/server/addons/hgexample/model/input/sysin/tenant_order.go new file mode 100644 index 0000000..61b44a6 --- /dev/null +++ b/server/addons/hgexample/model/input/sysin/tenant_order.go @@ -0,0 +1,123 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.13.1 +package sysin + +import ( + "context" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/form" + + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// TenantOrderUpdateFields 修改多租户功能演示字段过滤 +type TenantOrderUpdateFields struct { + TenantId int64 `json:"tenantId" dc:"租户ID"` + MerchantId int64 `json:"merchantId" dc:"商户ID"` + UserId int64 `json:"userId" dc:"用户ID"` + ProductName string `json:"productName" dc:"购买产品"` + OrderSn string `json:"orderSn" dc:"关联订单号"` + Money float64 `json:"money" dc:"充值金额"` + Remark string `json:"remark" dc:"备注"` + Status int `json:"status" dc:"支付状态"` +} + +// TenantOrderInsertFields 新增多租户功能演示字段过滤 +type TenantOrderInsertFields struct { + TenantId int64 `json:"tenantId" dc:"租户ID"` + MerchantId int64 `json:"merchantId" dc:"商户ID"` + UserId int64 `json:"userId" dc:"用户ID"` + ProductName string `json:"productName" dc:"购买产品"` + OrderSn string `json:"orderSn" dc:"关联订单号"` + Money float64 `json:"money" dc:"充值金额"` + Remark string `json:"remark" dc:"备注"` + Status int `json:"status" dc:"支付状态"` +} + +// TenantOrderEditInp 修改/新增多租户功能演示 +type TenantOrderEditInp struct { + entity.AddonHgexampleTenantOrder +} + +func (in *TenantOrderEditInp) Filter(ctx context.Context) (err error) { + // 验证充值金额 + if err := g.Validator().Rules("required").Data(in.Money).Messages("充值金额不能为空").Run(ctx); err != nil { + return err.Current() + } + + return +} + +type TenantOrderEditModel struct{} + +// TenantOrderDeleteInp 删除多租户功能演示 +type TenantOrderDeleteInp struct { + Id interface{} `json:"id" v:"required#主键不能为空" dc:"主键"` +} + +func (in *TenantOrderDeleteInp) Filter(ctx context.Context) (err error) { + return +} + +type TenantOrderDeleteModel struct{} + +// TenantOrderViewInp 获取指定多租户功能演示信息 +type TenantOrderViewInp struct { + Id int64 `json:"id" v:"required#主键不能为空" dc:"主键"` +} + +func (in *TenantOrderViewInp) Filter(ctx context.Context) (err error) { + return +} + +type TenantOrderViewModel struct { + entity.AddonHgexampleTenantOrder +} + +// TenantOrderListInp 获取多租户功能演示列表 +type TenantOrderListInp struct { + form.PageReq + Id int64 `json:"id" dc:"主键"` + TenantId int64 `json:"tenantId" dc:"租户ID"` + MerchantId int64 `json:"merchantId" dc:"商户ID"` + UserId int64 `json:"userId" dc:"用户ID"` + OrderSn string `json:"orderSn" dc:"关联订单号"` + Status int `json:"status" dc:"支付状态"` + CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"` +} + +func (in *TenantOrderListInp) Filter(ctx context.Context) (err error) { + return +} + +type TenantOrderListModel struct { + Id int64 `json:"id" dc:"主键"` + TenantId int64 `json:"tenantId" dc:"租户ID"` + MerchantId int64 `json:"merchantId" dc:"商户ID"` + UserId int64 `json:"userId" dc:"用户ID"` + ProductName string `json:"productName" dc:"购买产品"` + OrderSn string `json:"orderSn" dc:"关联订单号"` + Money float64 `json:"money" dc:"充值金额"` + Remark string `json:"remark" dc:"备注"` + Status int `json:"status" dc:"支付状态"` + CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` +} + +// TenantOrderExportModel 导出多租户功能演示 +type TenantOrderExportModel struct { + Id int64 `json:"id" dc:"主键"` + TenantId int64 `json:"tenantId" dc:"租户ID"` + MerchantId int64 `json:"merchantId" dc:"商户ID"` + UserId int64 `json:"userId" dc:"用户ID"` + ProductName string `json:"productName" dc:"购买产品"` + OrderSn string `json:"orderSn" dc:"关联订单号"` + Money float64 `json:"money" dc:"充值金额"` + Remark string `json:"remark" dc:"备注"` + Status int `json:"status" dc:"支付状态"` + CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"` +} diff --git a/server/addons/hgexample/model/input/sysin/tree_table.go b/server/addons/hgexample/model/input/sysin/tree_table.go new file mode 100644 index 0000000..02702c4 --- /dev/null +++ b/server/addons/hgexample/model/input/sysin/tree_table.go @@ -0,0 +1,47 @@ +// Package sysin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sysin + +import ( + "github.com/gogf/gf/v2/encoding/gjson" + "github.com/gogf/gf/v2/os/gtime" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/form" +) + +// TreeTableListInp 获取列表 +type TreeTableListInp struct { + form.PageReq + form.Sorters + Id int64 `json:"id" description:""` + Flag *gjson.Json `json:"flag" description:"标签"` + Title string `json:"title" description:"标题"` + Content string `json:"content" description:"内容"` + Price []float64 `json:"price" description:"价格"` + ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"` + Switch int `json:"switch" description:"开关"` + Hobby *gjson.Json `json:"hobby" description:"爱好"` + Status int `json:"status" description:"状态"` + CreatedAt []*gtime.Time `json:"createdAt" description:"创建时间"` + Pid int64 `json:"pid" description:"上级ID"` +} + +type TreeTableListModel struct { + entity.AddonHgexampleTable + TableCategoryName string `json:"TableCategoryName" description:"分类名称"` + TableCategoryDescription string `json:"TableCategoryDescription" description:"分类描述"` + TableCategoryRemark string `json:"TableCategoryRemark" description:"分类备注"` + SysProvincesTitle string `json:"sysProvincesTitle" description:""` +} + +// TableTree 树 +type TableTree struct { + entity.AddonHgexampleTable + Key int64 `json:"key" dc:"key"` + Label string `json:"label" dc:"标签"` + Value int64 `json:"value" dc:"键值"` + Children []*TableTree `json:"children"` +} diff --git a/server/addons/hgexample/queues/queues.go b/server/addons/hgexample/queues/queues.go new file mode 100644 index 0000000..9f2e7eb --- /dev/null +++ b/server/addons/hgexample/queues/queues.go @@ -0,0 +1,9 @@ +// Package queues +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package queues + +// 消息队列. +// 插件中的消息队列消费者可以统一在这里注册和处理 diff --git a/server/addons/hgexample/router/admin.go b/server/addons/hgexample/router/admin.go new file mode 100644 index 0000000..75884df --- /dev/null +++ b/server/addons/hgexample/router/admin.go @@ -0,0 +1,36 @@ +// Package router +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package router + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "hotgo/addons/hgexample/controller/admin/sys" + "hotgo/addons/hgexample/global" + "hotgo/addons/hgexample/router/genrouter" + "hotgo/internal/consts" + "hotgo/internal/library/addons" + "hotgo/internal/service" +) + +func Admin(ctx context.Context, group *ghttp.RouterGroup) { + prefix := addons.RouterPrefix(ctx, consts.AppAdmin, global.GetSkeleton().Name) + group.Group(prefix, func(group *ghttp.RouterGroup) { + group.Bind( + sys.Index, + ) + group.Middleware(service.Middleware().AdminAuth) + group.Bind( + sys.Comp, + sys.Config, + sys.Table, + sys.TreeTable, + ) + }) + + // 注册生成路由 + genrouter.Register(ctx, group) +} diff --git a/server/addons/hgexample/router/api.go b/server/addons/hgexample/router/api.go new file mode 100644 index 0000000..60c3626 --- /dev/null +++ b/server/addons/hgexample/router/api.go @@ -0,0 +1,32 @@ +// Package router +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package router + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "hotgo/addons/hgexample/controller/api" + "hotgo/addons/hgexample/global" + "hotgo/internal/consts" + "hotgo/internal/library/addons" + "hotgo/internal/service" +) + +// Api 前台路由 +func Api(ctx context.Context, group *ghttp.RouterGroup) { + prefix := addons.RouterPrefix(ctx, consts.AppApi, global.GetSkeleton().Name) + group.Group(prefix, func(group *ghttp.RouterGroup) { + group.Bind( + // 无需验证的路由 + api.Index, + ) + group.Middleware(service.Middleware().ApiAuth) + group.Bind( + // 需要验证的路由 + // ... + ) + }) +} diff --git a/server/addons/hgexample/router/genrouter/init.go b/server/addons/hgexample/router/genrouter/init.go new file mode 100644 index 0000000..d15d513 --- /dev/null +++ b/server/addons/hgexample/router/genrouter/init.go @@ -0,0 +1,34 @@ +// Package genrouter +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package genrouter + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "hotgo/addons/hgexample/global" + "hotgo/internal/consts" + "hotgo/internal/library/addons" + "hotgo/internal/service" +) + +var ( + NoLoginRouter []interface{} // 无需登录 + LoginRequiredRouter []interface{} // 需要登录 +) + +// Register 注册通过代码生成的后台路由 +func Register(ctx context.Context, group *ghttp.RouterGroup) { + prefix := addons.RouterPrefix(ctx, consts.AppAdmin, global.GetSkeleton().Name) + group.Group(prefix, func(group *ghttp.RouterGroup) { + if len(NoLoginRouter) > 0 { + group.Bind(NoLoginRouter...) + } + group.Middleware(service.Middleware().AdminAuth) + if len(LoginRequiredRouter) > 0 { + group.Bind(LoginRequiredRouter...) + } + }) +} diff --git a/server/addons/hgexample/router/genrouter/tenant_order.go b/server/addons/hgexample/router/genrouter/tenant_order.go new file mode 100644 index 0000000..15aa5b0 --- /dev/null +++ b/server/addons/hgexample/router/genrouter/tenant_order.go @@ -0,0 +1,13 @@ +// Package genrouter +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.13.1 +package genrouter + +import "hotgo/addons/hgexample/controller/admin/sys" + +func init() { + LoginRequiredRouter = append(LoginRequiredRouter, sys.TenantOrder) // 多租户功能演示 +} \ No newline at end of file diff --git a/server/addons/hgexample/router/home.go b/server/addons/hgexample/router/home.go new file mode 100644 index 0000000..d985980 --- /dev/null +++ b/server/addons/hgexample/router/home.go @@ -0,0 +1,25 @@ +// Package router +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package router + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "hotgo/addons/hgexample/controller/home" + "hotgo/addons/hgexample/global" + "hotgo/internal/consts" + "hotgo/internal/library/addons" +) + +// Home 前台页面路由 +func Home(ctx context.Context, group *ghttp.RouterGroup) { + prefix := addons.RouterPrefix(ctx, consts.AppHome, global.GetSkeleton().Name) + group.Group(prefix, func(group *ghttp.RouterGroup) { + group.Bind( + home.Index, + ) + }) +} diff --git a/server/addons/hgexample/router/websocket.go b/server/addons/hgexample/router/websocket.go new file mode 100644 index 0000000..b2ec122 --- /dev/null +++ b/server/addons/hgexample/router/websocket.go @@ -0,0 +1,40 @@ +// Package router +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package router + +import ( + "context" + "github.com/gogf/gf/v2/net/ghttp" + "hotgo/addons/hgexample/controller/websocket" + "hotgo/addons/hgexample/controller/websocket/handler" + "hotgo/addons/hgexample/global" + "hotgo/internal/consts" + "hotgo/internal/library/addons" + "hotgo/internal/service" + ws "hotgo/internal/websocket" +) + +// WebSocket ws路由配置 +func WebSocket(ctx context.Context, group *ghttp.RouterGroup) { + prefix := addons.RouterPrefix(ctx, consts.AppWebSocket, global.GetSkeleton().Name) + group.Group(prefix, func(group *ghttp.RouterGroup) { + group.Bind( + // 无需验证的路由 + websocket.Index, + ) + // ws连接中间件 + group.Middleware(service.Middleware().WebSocketAuth) + group.Bind( + // 需要验证的路由 + // .. + ) + }) + + // 注册消息路由 + ws.RegisterMsg(ws.EventHandlers{ + "admin/addons/hgexample/testMessage": handler.Index.TestMessage, // 测试消息 + }) +} diff --git a/server/addons/hgexample/service/.gitkeep b/server/addons/hgexample/service/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/server/addons/hgexample/service/sys.go b/server/addons/hgexample/service/sys.go new file mode 100644 index 0000000..9ad290d --- /dev/null +++ b/server/addons/hgexample/service/sys.go @@ -0,0 +1,139 @@ +// ================================================================================ +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// You can delete these comments if you wish manually maintain this interface file. +// ================================================================================ + +package service + +import ( + "context" + "hotgo/addons/hgexample/model" + "hotgo/addons/hgexample/model/input/sysin" + "hotgo/internal/library/hgorm/handler" + + "github.com/gogf/gf/v2/database/gdb" +) + +type ( + ISysConfig interface { + // GetBasic 获取基础配置 + GetBasic(ctx context.Context) (conf *model.BasicConfig, err error) + // GetConfigByGroup 获取指定分组配置 + GetConfigByGroup(ctx context.Context, in *sysin.GetConfigInp) (res *sysin.GetConfigModel, err error) + // UpdateConfigByGroup 更新指定分组的配置 + UpdateConfigByGroup(ctx context.Context, in *sysin.UpdateConfigInp) error + } + ISysIndex interface { + // Test 测试 + Test(ctx context.Context, in *sysin.IndexTestInp) (res *sysin.IndexTestModel, err error) + } + ISysTable interface { + // Model Orm模型 + Model(ctx context.Context, option ...*handler.Option) *gdb.Model + // List 获取列表 + List(ctx context.Context, in *sysin.TableListInp) (list []*sysin.TableListModel, totalCount int, err error) + // Export 导出 + Export(ctx context.Context, in *sysin.TableListInp) (err error) + // Edit 修改/新增 + Edit(ctx context.Context, in *sysin.TableEditInp) (err error) + // Delete 删除 + Delete(ctx context.Context, in *sysin.TableDeleteInp) (err error) + // Status 更新状态 + Status(ctx context.Context, in *sysin.TableStatusInp) (err error) + // Switch 更新开关状态 + Switch(ctx context.Context, in *sysin.TableSwitchInp) (err error) + // MaxSort 最大排序 + MaxSort(ctx context.Context, in *sysin.TableMaxSortInp) (res *sysin.TableMaxSortModel, err error) + // View 获取指定信息 + View(ctx context.Context, in *sysin.TableViewInp) (res *sysin.TableViewModel, err error) + } + ISysTenantOrder interface { + // Model 多租户功能演示ORM模型 + Model(ctx context.Context, option ...*handler.Option) *gdb.Model + // List 获取多租户功能演示列表 + List(ctx context.Context, in *sysin.TenantOrderListInp) (list []*sysin.TenantOrderListModel, totalCount int, err error) + // Export 导出多租户功能演示 + Export(ctx context.Context, in *sysin.TenantOrderListInp) (err error) + // Edit 修改/新增多租户功能演示 + Edit(ctx context.Context, in *sysin.TenantOrderEditInp) (err error) + // Delete 删除多租户功能演示 + Delete(ctx context.Context, in *sysin.TenantOrderDeleteInp) (err error) + // View 获取多租户功能演示指定信息 + View(ctx context.Context, in *sysin.TenantOrderViewInp) (res *sysin.TenantOrderViewModel, err error) + } + ISysTreeTable interface { + // Model Orm模型 + Model(ctx context.Context, option ...*handler.Option) *gdb.Model + // List 获取列表 + List(ctx context.Context, in *sysin.TreeTableListInp) (list []*sysin.TreeTableListModel, totalCount int, err error) + // Edit 修改/新增 + Edit(ctx context.Context, in *sysin.TableEditInp) (err error) + // Delete 删除 + Delete(ctx context.Context, in *sysin.TableDeleteInp) (err error) + // Select 关系树选项列表 + Select(ctx context.Context) (list []*sysin.TableTree, err error) + } +) + +var ( + localSysConfig ISysConfig + localSysIndex ISysIndex + localSysTable ISysTable + localSysTenantOrder ISysTenantOrder + localSysTreeTable ISysTreeTable +) + +func SysConfig() ISysConfig { + if localSysConfig == nil { + panic("implement not found for interface ISysConfig, forgot register?") + } + return localSysConfig +} + +func RegisterSysConfig(i ISysConfig) { + localSysConfig = i +} + +func SysIndex() ISysIndex { + if localSysIndex == nil { + panic("implement not found for interface ISysIndex, forgot register?") + } + return localSysIndex +} + +func RegisterSysIndex(i ISysIndex) { + localSysIndex = i +} + +func SysTable() ISysTable { + if localSysTable == nil { + panic("implement not found for interface ISysTable, forgot register?") + } + return localSysTable +} + +func RegisterSysTable(i ISysTable) { + localSysTable = i +} + +func SysTenantOrder() ISysTenantOrder { + if localSysTenantOrder == nil { + panic("implement not found for interface ISysTenantOrder, forgot register?") + } + return localSysTenantOrder +} + +func RegisterSysTenantOrder(i ISysTenantOrder) { + localSysTenantOrder = i +} + +func SysTreeTable() ISysTreeTable { + if localSysTreeTable == nil { + panic("implement not found for interface ISysTreeTable, forgot register?") + } + return localSysTreeTable +} + +func RegisterSysTreeTable(i ISysTreeTable) { + localSysTreeTable = i +} diff --git a/server/addons/modules/.gitkeep b/server/addons/modules/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/server/addons/modules/hgexample.go b/server/addons/modules/hgexample.go new file mode 100644 index 0000000..eafbc58 --- /dev/null +++ b/server/addons/modules/hgexample.go @@ -0,0 +1,8 @@ +// Package modules +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package modules + +import _ "hotgo/addons/hgexample" diff --git a/server/api/admin/addons/addons.go b/server/api/admin/addons/addons.go new file mode 100644 index 0000000..83dd492 --- /dev/null +++ b/server/api/admin/addons/addons.go @@ -0,0 +1,59 @@ +// Package addons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package addons + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/addons/list" method:"get" tags:"插件管理" summary:"获取插件列表"` + sysin.AddonsListInp +} + +type ListRes struct { + List []*sysin.AddonsListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// BuildReq 提交生成 +type BuildReq struct { + g.Meta `path:"/addons/build" method:"post" tags:"插件管理" summary:"提交生成"` + sysin.AddonsBuildInp +} + +type BuildRes struct { +} + +// InstallReq 安装模块 +type InstallReq struct { + g.Meta `path:"/addons/install" method:"post" tags:"插件管理" summary:"安装模块"` + sysin.AddonsInstallInp +} + +type InstallRes struct { +} + +// UpgradeReq 更新模块 +type UpgradeReq struct { + g.Meta `path:"/addons/upgrade" method:"post" tags:"插件管理" summary:"更新模块"` + sysin.AddonsUpgradeInp +} + +type UpgradeRes struct { +} + +// UnInstallReq 卸载模块 +type UnInstallReq struct { + g.Meta `path:"/addons/uninstall" method:"post" tags:"插件管理" summary:"卸载模块"` + sysin.AddonsUnInstallInp +} + +type UnInstallRes struct { +} diff --git a/server/api/admin/appmember/appmember.go b/server/api/admin/appmember/appmember.go new file mode 100644 index 0000000..3da74e1 --- /dev/null +++ b/server/api/admin/appmember/appmember.go @@ -0,0 +1,149 @@ +package appmember + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +type ListReq struct { + g.Meta `path:"/appMember/list" method:"get" tags:"会员管理" summary:"会员列表"` + sysin.AppMemberListInp +} +type ListRes struct { + form.PageRes + List []*sysin.AppMemberListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/appMember/view" method:"get" tags:"会员管理" summary:"会员详情"` + sysin.AppMemberViewInp +} +type ViewRes struct{ *sysin.AppMemberViewModel } +type EditReq struct { + g.Meta `path:"/appMember/edit" method:"post" tags:"会员管理" summary:"新增编辑会员"` + sysin.AppMemberEditInp +} +type EditRes struct{} +type DeleteReq struct { + g.Meta `path:"/appMember/delete" method:"post" tags:"会员管理" summary:"注销会员"` + sysin.AppMemberDeleteInp +} +type DeleteRes struct{} +type AutoDispatchReq struct { + g.Meta `path:"/appMember/autoDispatch" method:"post" tags:"会员管理" summary:"切换派单模式"` + sysin.AppMemberAutoDispatchInp +} +type AutoDispatchRes struct{} +type CategoryReq struct { + g.Meta `path:"/appMember/category" method:"post" tags:"会员管理" summary:"切换会员真人假人类别"` + sysin.AppMemberCategoryInp +} +type CategoryRes struct{} + +type PaymentListReq struct { + g.Meta `path:"/appMember/paymentList" method:"get" tags:"会员管理" summary:"收款账户列表"` + sysin.AppMemberPaymentListInp +} +type PaymentListRes struct { + List []*sysin.AppMemberPaymentModel `json:"list"` +} +type PaymentEditReq struct { + g.Meta `path:"/appMember/paymentEdit" method:"post" tags:"会员管理" summary:"新增编辑收款账户"` + sysin.AppMemberPaymentEditInp +} +type PaymentEditRes struct{} +type PaymentDeleteReq struct { + g.Meta `path:"/appMember/paymentDelete" method:"post" tags:"会员管理" summary:"删除收款账户"` + sysin.AppMemberPaymentDeleteInp +} +type PaymentDeleteRes struct{} + +type AddressListReq struct { + g.Meta `path:"/appMember/addressList" method:"get" tags:"会员管理" summary:"地址列表"` + sysin.AppMemberAddressListInp +} +type AddressListRes struct { + List []*sysin.AppMemberAddressModel `json:"list"` +} +type AddressEditReq struct { + g.Meta `path:"/appMember/addressEdit" method:"post" tags:"会员管理" summary:"新增编辑地址"` + sysin.AppMemberAddressEditInp +} +type AddressEditRes struct{} +type AddressDeleteReq struct { + g.Meta `path:"/appMember/addressDelete" method:"post" tags:"会员管理" summary:"删除地址"` + sysin.AppMemberAddressDeleteInp +} +type AddressDeleteRes struct{} + +type SensitiveReq struct { + g.Meta `path:"/appMember/sensitive" method:"post" tags:"会员管理" summary:"授权查看敏感信息"` + sysin.AppMemberSensitiveInp +} +type SensitiveRes struct{ *sysin.AppMemberSensitiveModel } +type TeamReq struct { + g.Meta `path:"/appMember/team" method:"get" tags:"会员管理" summary:"团队查询"` + sysin.AppMemberTeamInp +} +type TeamRes struct { + form.PageRes + List []*sysin.AppMemberTeamModel `json:"list"` +} + +type StatusRequestReq struct { + g.Meta `path:"/appMember/statusRequest" method:"post" tags:"会员管理" summary:"发起会员状态审批"` + sysin.AppMemberStatusRequestInp +} +type StatusRequestRes struct{ *sysin.AppMemberApprovalModel } +type StatusExecuteReq struct { + g.Meta `path:"/appMember/statusExecute" method:"post" tags:"会员管理" summary:"执行已审批会员状态变更"` + sysin.AppMemberStatusExecuteInp +} +type StatusExecuteRes struct{} + +type WalletListReq struct { + g.Meta `path:"/appMember/walletList" method:"get" tags:"会员管理" summary:"资金调账列表"` + sysin.WalletAdjustmentListInp +} +type WalletListRes struct { + form.PageRes + List []*sysin.WalletAdjustmentListModel `json:"list"` +} +type LedgerListReq struct { + g.Meta `path:"/appMember/ledgerList" method:"get" tags:"会员管理" summary:"会员账变流水"` + sysin.WalletLedgerListInp +} +type LedgerListRes struct { + form.PageRes + List []*sysin.WalletLedgerListModel `json:"list"` +} +type WalletRequestReq struct { + g.Meta `path:"/appMember/walletRequest" method:"post" tags:"会员管理" summary:"发起资金调账审批"` + sysin.WalletAdjustmentRequestInp +} +type WalletRequestRes struct{ *sysin.AppMemberApprovalModel } +type WalletExecuteReq struct { + g.Meta `path:"/appMember/walletExecute" method:"post" tags:"会员管理" summary:"执行已审批资金调账"` + sysin.WalletAdjustmentExecuteInp +} +type WalletExecuteRes struct{} + +type NoticeListReq struct { + g.Meta `path:"/appMember/noticeList" method:"get" tags:"会员管理" summary:"会员通知列表"` + sysin.MemberNoticeListInp +} +type NoticeListRes struct { + form.PageRes + List []*sysin.MemberNoticeListModel `json:"list"` +} +type NoticeEditReq struct { + g.Meta `path:"/appMember/noticeEdit" method:"post" tags:"会员管理" summary:"创建会员通知"` + sysin.MemberNoticeEditInp +} +type NoticeEditRes struct{} +type NoticeRevokeReq struct { + g.Meta `path:"/appMember/noticeRevoke" method:"post" tags:"会员管理" summary:"撤回会员通知"` + sysin.MemberNoticeRevokeInp +} +type NoticeRevokeRes struct{} diff --git a/server/api/admin/approval/approval.go b/server/api/admin/approval/approval.go new file mode 100644 index 0000000..9a099a5 --- /dev/null +++ b/server/api/admin/approval/approval.go @@ -0,0 +1,53 @@ +package approval + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +type ListReq struct { + g.Meta `path:"/approval/list" method:"get" tags:"审批中心" summary:"获取审批列表"` + sysin.ApprovalListInp +} +type ListRes struct { + form.PageRes + List []*sysin.ApprovalListModel `json:"list" dc:"数据列表"` +} + +type ViewReq struct { + g.Meta `path:"/approval/view" method:"get" tags:"审批中心" summary:"获取审批详情"` + sysin.ApprovalViewInp +} +type ViewRes struct{ *sysin.ApprovalViewModel } + +type CreateReq struct { + g.Meta `path:"/approval/create" method:"post" tags:"审批中心" summary:"创建审批草稿"` + sysin.ApprovalCreateInp +} +type CreateRes struct{ *sysin.ApprovalCreateModel } + +type SubmitReq struct { + g.Meta `path:"/approval/submit" method:"post" tags:"审批中心" summary:"提交审批"` + sysin.ApprovalSubmitInp +} +type SubmitRes struct{} + +type ApproveReq struct { + g.Meta `path:"/approval/approve" method:"post" tags:"审批中心" summary:"通过审批"` + sysin.ApprovalDecisionInp +} +type ApproveRes struct{} + +type RejectReq struct { + g.Meta `path:"/approval/reject" method:"post" tags:"审批中心" summary:"驳回审批"` + sysin.ApprovalDecisionInp +} +type RejectRes struct{} + +type CancelReq struct { + g.Meta `path:"/approval/cancel" method:"post" tags:"审批中心" summary:"取消审批"` + sysin.ApprovalCancelInp +} +type CancelRes struct{} diff --git a/server/api/admin/attachment/attachment.go b/server/api/admin/attachment/attachment.go new file mode 100644 index 0000000..df58a31 --- /dev/null +++ b/server/api/admin/attachment/attachment.go @@ -0,0 +1,49 @@ +// Package attachment +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package attachment + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询附件列表 +type ListReq struct { + g.Meta `path:"/attachment/list" method:"get" tags:"附件" summary:"获取附件列表"` + sysin.AttachmentListInp +} + +type ListRes struct { + List []*sysin.AttachmentListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取附件信息 +type ViewReq struct { + g.Meta `path:"/attachment/view" method:"get" tags:"附件" summary:"获取指定附件信息"` + sysin.AttachmentViewInp +} + +type ViewRes struct { + *sysin.AttachmentViewModel +} + +// DeleteReq 删除附件 +type DeleteReq struct { + g.Meta `path:"/attachment/delete" method:"post" tags:"附件" summary:"删除附件"` + sysin.AttachmentDeleteInp +} + +type DeleteRes struct{} + +// ClearKindReq 清空上传类型 +type ClearKindReq struct { + g.Meta `path:"/attachment/clearKind" method:"post" tags:"附件" summary:"清空上传类型"` + sysin.AttachmentClearKindInp +} + +type ClearKindRes struct{} diff --git a/server/api/admin/bizaudit/biz_audit.go b/server/api/admin/bizaudit/biz_audit.go new file mode 100644 index 0000000..00fb653 --- /dev/null +++ b/server/api/admin/bizaudit/biz_audit.go @@ -0,0 +1,23 @@ +package bizaudit + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +type ListReq struct { + g.Meta `path:"/bizAudit/list" method:"get" tags:"业务审计" summary:"获取业务审计列表"` + sysin.BizAuditListInp +} +type ListRes struct { + form.PageRes + List []*sysin.BizAuditListModel `json:"list" dc:"数据列表"` +} + +type ViewReq struct { + g.Meta `path:"/bizAudit/view" method:"get" tags:"业务审计" summary:"获取业务审计详情"` + sysin.BizAuditViewInp +} +type ViewRes struct{ *sysin.BizAuditViewModel } diff --git a/server/api/admin/blacklist/blacklist.go b/server/api/admin/blacklist/blacklist.go new file mode 100644 index 0000000..97c7475 --- /dev/null +++ b/server/api/admin/blacklist/blacklist.go @@ -0,0 +1,57 @@ +// Package blacklist +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package blacklist + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/blacklist/list" method:"get" tags:"黑名单" summary:"获取黑名单列表"` + sysin.BlacklistListInp +} + +type ListRes struct { + List []*sysin.BlacklistListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取信息 +type ViewReq struct { + g.Meta `path:"/blacklist/view" method:"get" tags:"黑名单" summary:"获取指定信息"` + sysin.BlacklistViewInp +} + +type ViewRes struct { + *sysin.BlacklistViewModel +} + +// EditReq 修改/新增 +type EditReq struct { + g.Meta `path:"/blacklist/edit" method:"post" tags:"黑名单" summary:"修改/新增黑名单"` + sysin.BlacklistEditInp +} + +type EditRes struct{} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/blacklist/delete" method:"post" tags:"黑名单" summary:"删除黑名单"` + sysin.BlacklistDeleteInp +} + +type DeleteRes struct{} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/blacklist/status" method:"post" tags:"黑名单" summary:"更新黑名单状态"` + sysin.BlacklistStatusInp +} + +type StatusRes struct{} diff --git a/server/api/admin/cash/cash.go b/server/api/admin/cash/cash.go new file mode 100644 index 0000000..0d82d1f --- /dev/null +++ b/server/api/admin/cash/cash.go @@ -0,0 +1,49 @@ +// Package cash +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cash + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/cash/list" method:"get" tags:"提现" summary:"获取提现列表"` + adminin.CashListInp +} + +type ListRes struct { + List []*adminin.CashListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/cash/view" method:"get" tags:"提现" summary:"获取指定信息"` + adminin.CashViewInp +} + +type ViewRes struct { + *adminin.CashViewModel +} + +// ApplyReq 申请提现 +type ApplyReq struct { + g.Meta `path:"/cash/apply" method:"post" tags:"提现" summary:"申请提现"` + Money float64 `json:"money" description:"提现金额"` +} + +type ApplyRes struct{} + +// PaymentReq 提现打款处理 +type PaymentReq struct { + g.Meta `path:"/cash/payment" method:"post" tags:"提现" summary:"提现打款处理"` + adminin.CashPaymentInp +} + +type PaymentRes struct{} diff --git a/server/api/admin/common/console.go b/server/api/admin/common/console.go new file mode 100644 index 0000000..591b13c --- /dev/null +++ b/server/api/admin/common/console.go @@ -0,0 +1,52 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +// ConsoleStatReq 控制台统计 +type ConsoleStatReq struct { + g.Meta `path:"/console/stat" method:"get" tags:"控制台" summary:"综合数据统计"` +} + +type ConsoleStatRes struct { + Visits struct { + DayVisits float64 `json:"dayVisits"` + Rise float64 `json:"rise"` + Decline float64 `json:"decline"` + Amount float64 `json:"amount"` + } `json:"visits"` + Saleroom struct { + WeekSaleroom float64 `json:"weekSaleroom"` + Amount float64 `json:"amount"` + Degree float64 `json:"degree"` + } `json:"saleroom"` + OrderLarge struct { + WeekLarge float64 `json:"weekLarge"` + Rise float64 `json:"rise"` + Decline float64 `json:"decline"` + Amount float64 `json:"amount"` + } `json:"orderLarge"` + Volume struct { + WeekLarge float64 `json:"weekLarge"` + Rise float64 `json:"rise"` + Decline float64 `json:"decline"` + Amount float64 `json:"amount"` + } `json:"volume"` +} + +type DashboardSummaryReq struct { + g.Meta `path:"/dashboard/summary" method:"get" tags:"控制台" summary:"业务数据看板"` + sysin.DashboardSummaryInp +} + +type DashboardSummaryRes struct { + *sysin.DashboardSummaryModel +} diff --git a/server/api/admin/common/ems.go b/server/api/admin/common/ems.go new file mode 100644 index 0000000..82a5a53 --- /dev/null +++ b/server/api/admin/common/ems.go @@ -0,0 +1,27 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// SendTestEmailReq 发送测试邮件 +type SendTestEmailReq struct { + g.Meta `path:"/ems/sendTest" tags:"邮件" method:"post" summary:"发送测试邮件"` + To string `json:"to" v:"required#接收者邮件不能为空" dc:"接收者邮件,多个用;隔开"` +} + +type SendTestEmailRes struct { +} + +// SendBindEmsReq 发送换绑邮件 +type SendBindEmsReq struct { + g.Meta `path:"/ems/sendBind" tags:"邮件" method:"post" summary:"发送换绑邮件"` +} + +type SendBindEmsRes struct { +} diff --git a/server/api/admin/common/site.go b/server/api/admin/common/site.go new file mode 100644 index 0000000..7825a4c --- /dev/null +++ b/server/api/admin/common/site.go @@ -0,0 +1,90 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model" + "hotgo/internal/model/input/adminin" +) + +// LoginLogoutReq 注销登录 +type LoginLogoutReq struct { + g.Meta `path:"/site/logout" method:"post" tags:"后台基础" summary:"注销登录"` +} + +type LoginLogoutRes struct{} + +// RegisterReq 提交账号注册 +type RegisterReq struct { + g.Meta `path:"/site/register" method:"post" tags:"后台基础" summary:"账号注册"` + adminin.RegisterInp +} + +type RegisterRes struct { + *adminin.LoginModel +} + +// LoginCaptchaReq 获取登录验证码 +type LoginCaptchaReq struct { + g.Meta `path:"/site/captcha" method:"get" tags:"后台基础" summary:"获取登录验证码"` +} + +type LoginCaptchaRes struct { + Cid string `json:"cid" dc:"验证码ID"` + Base64 string `json:"base64" dc:"验证码"` +} + +// AccountLoginReq 提交账号登录 +type AccountLoginReq struct { + g.Meta `path:"/site/accountLogin" method:"post" tags:"后台基础" summary:"账号登录"` + adminin.AccountLoginInp +} + +type AccountLoginRes struct { + *adminin.LoginModel +} + +// MobileLoginReq 提交手机号登录 +type MobileLoginReq struct { + g.Meta `path:"/site/mobileLogin" method:"post" tags:"后台基础" summary:"手机号登录"` + adminin.MobileLoginInp +} + +type MobileLoginRes struct { + *adminin.LoginModel +} + +// SiteConfigReq 获取配置 +type SiteConfigReq struct { + g.Meta `path:"/site/config" method:"get" tags:"后台基础" summary:"获取配置"` +} + +type SiteConfigRes struct { + Version string `json:"version" dc:"系统版本"` + WsAddr string `json:"wsAddr" dc:"客户端websocket地址"` + Domain string `json:"domain" dc:"对外域名"` + Mode string `json:"mode" dc:"运行模式"` +} + +// SiteLoginConfigReq 获取登录配置 +type SiteLoginConfigReq struct { + g.Meta `path:"/site/loginConfig" method:"get" tags:"后台基础" summary:"获取登录配置"` +} + +type SiteLoginConfigRes struct { + *model.LoginConfig + I18nSwitch bool `json:"i18nSwitch" dc:"国际化开关"` + DefaultLanguage string `json:"defaultLanguage" dc:"默认语言设置"` + ProjectName string `json:"projectName" dc:"项目名称"` +} + +// SitePingReq ping +type SitePingReq struct { + g.Meta `path:"/site/ping" method:"get" tags:"后台基础" summary:"ping"` +} + +type SitePingRes struct{} diff --git a/server/api/admin/common/sms.go b/server/api/admin/common/sms.go new file mode 100644 index 0000000..53ebbd1 --- /dev/null +++ b/server/api/admin/common/sms.go @@ -0,0 +1,37 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/sysin" +) + +// SendTestSmsReq 发送测试短信 +type SendTestSmsReq struct { + g.Meta `path:"/sms/sendTest" tags:"短信" method:"post" summary:"发送测试短信"` + sysin.SendCodeInp +} + +type SendTestSmsRes struct { +} + +// SendBindSmsReq 发送换绑短信 +type SendBindSmsReq struct { + g.Meta `path:"/sms/sendBind" tags:"短信" method:"post" summary:"发送换绑短信"` +} + +type SendBindSmsRes struct { +} + +// SendSmsReq 发送短信 +type SendSmsReq struct { + g.Meta `path:"/sms/send" tags:"短信" method:"post" summary:"发送短信"` + sysin.SendCodeInp +} + +type SendSmsRes struct { +} diff --git a/server/api/admin/common/upload.go b/server/api/admin/common/upload.go new file mode 100644 index 0000000..8f1afb3 --- /dev/null +++ b/server/api/admin/common/upload.go @@ -0,0 +1,48 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/sysin" +) + +// UploadFileReq 上传文件 +type UploadFileReq struct { + g.Meta `path:"/upload/file" tags:"附件" method:"post" summary:"上传附件"` +} + +type UploadFileRes *sysin.AttachmentListModel + +// CheckMultipartReq 检查文件分片 +type CheckMultipartReq struct { + g.Meta `path:"/upload/checkMultipart" tags:"附件" method:"post" summary:"检查文件分片"` + sysin.CheckMultipartInp +} + +type CheckMultipartRes struct { + *sysin.CheckMultipartModel +} + +// UploadPartReq 分片上传 +type UploadPartReq struct { + g.Meta `path:"/upload/uploadPart" tags:"附件" method:"post" summary:"分片上传"` + sysin.UploadPartInp +} + +type UploadPartRes struct { + *sysin.UploadPartModel +} + +// ImageTransferStorageReq 图片链接转存 +type ImageTransferStorageReq struct { + g.Meta `path:"/upload/imageTransferStorage" tags:"附件" method:"post" summary:"图片链接转存"` + sysin.ImageTransferStorageInp +} + +type ImageTransferStorageRes struct { + *sysin.ImageTransferStorageModel +} diff --git a/server/api/admin/common/wechat.go b/server/api/admin/common/wechat.go new file mode 100644 index 0000000..c7af478 --- /dev/null +++ b/server/api/admin/common/wechat.go @@ -0,0 +1,31 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/commonin" +) + +// WechatAuthorizeReq 微信用户授权 +type WechatAuthorizeReq struct { + g.Meta `path:"/wechat/authorize" method:"get" tags:"微信" summary:"微信用户授权"` + commonin.WechatAuthorizeInp +} + +type WechatAuthorizeRes struct { + *commonin.WechatAuthorizeModel +} + +// WechatAuthorizeCallReq 微信用户授权回调 +type WechatAuthorizeCallReq struct { + g.Meta `path:"/wechat/authorizeCall" method:"get" tags:"微信" summary:"微信用户授权"` + commonin.WechatAuthorizeCallInp +} + +type WechatAuthorizeCallRes struct { + *commonin.WechatAuthorizeCallModel +} diff --git a/server/api/admin/config/config.go b/server/api/admin/config/config.go new file mode 100644 index 0000000..cc8b9b5 --- /dev/null +++ b/server/api/admin/config/config.go @@ -0,0 +1,47 @@ +// Package config +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package config + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// GetReq 获取指定分组的配置 +type GetReq struct { + g.Meta `path:"/config/get" method:"get" tags:"配置" summary:"获取指定分组的配置"` + sysin.GetConfigInp +} + +type GetRes struct { + *sysin.GetConfigModel +} + +// UpdateReq 获取指定分组的配置 +type UpdateReq struct { + g.Meta `path:"/config/update" method:"post" tags:"配置" summary:"获取指定分组的配置"` + sysin.UpdateConfigInp +} + +type UpdateRes struct { +} + +// TypeSelectReq 数据类型选项 +type TypeSelectReq struct { + g.Meta `path:"/config/typeSelect" method:"get" tags:"配置" summary:"数据类型选项"` +} + +type TypeSelectRes []form.Select + +// GetCashReq 获取提现配置 +type GetCashReq struct { + g.Meta `path:"/config/getCash" method:"get" tags:"配置" summary:"获取提现配置"` +} + +type GetCashRes struct { + *sysin.GetConfigModel +} diff --git a/server/api/admin/creditslog/creditslog.go b/server/api/admin/creditslog/creditslog.go new file mode 100644 index 0000000..bec4694 --- /dev/null +++ b/server/api/admin/creditslog/creditslog.go @@ -0,0 +1,33 @@ +// Package creditslog +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.5.3 +// @AutoGenerate Date 2023-04-15 15:59:58 +package creditslog + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// ListReq 查询资产变动列表 +type ListReq struct { + g.Meta `path:"/creditsLog/list" method:"get" tags:"资产变动" summary:"获取资产变动列表"` + adminin.CreditsLogListInp +} + +type ListRes struct { + form.PageRes + List []*adminin.CreditsLogListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出资产变动列表 +type ExportReq struct { + g.Meta `path:"/creditsLog/export" method:"get" tags:"资产变动" summary:"导出资产变动列表"` + adminin.CreditsLogListInp +} + +type ExportRes struct{} diff --git a/server/api/admin/cron/cron.go b/server/api/admin/cron/cron.go new file mode 100644 index 0000000..87f7267 --- /dev/null +++ b/server/api/admin/cron/cron.go @@ -0,0 +1,93 @@ +// Package cron +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cron + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/cron/list" method:"get" tags:"定时任务" summary:"获取定时任务列表"` + sysin.CronListInp +} + +type ListRes struct { + List []*sysin.CronListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取信息 +type ViewReq struct { + g.Meta `path:"/cron/view" method:"get" tags:"定时任务" summary:"获取指定信息"` + sysin.CronViewInp +} + +type ViewRes struct { + *sysin.CronViewModel +} + +// EditReq 修改/新增 +type EditReq struct { + g.Meta `path:"/cron/edit" method:"post" tags:"定时任务" summary:"修改/新增定时任务"` + sysin.CronEditInp +} + +type EditRes struct { + *sysin.CronEditModel +} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/cron/delete" method:"post" tags:"定时任务" summary:"删除定时任务"` + sysin.CronDeleteInp +} + +type DeleteRes struct { + *sysin.CronDeleteModel +} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/cron/maxSort" method:"get" tags:"定时任务" summary:"定时任务最大排序"` + sysin.CronMaxSortInp +} + +type MaxSortRes struct { + *sysin.CronMaxSortModel +} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/cron/status" method:"post" tags:"定时任务" summary:"更新定时任务状态"` + sysin.CronStatusInp +} + +type StatusRes struct { + *sysin.CronStatusModel +} + +// OnlineExecReq 在线执行 +type OnlineExecReq struct { + g.Meta `path:"/cron/onlineExec" method:"post" tags:"定时任务" summary:"在线执行"` + sysin.OnlineExecInp +} + +type OnlineExecRes struct { + *sysin.OnlineExecModel +} + +// DispatchLogReq 调度日志 +type DispatchLogReq struct { + g.Meta `path:"/cron/dispatchLog" method:"post" tags:"定时任务" summary:"调度日志"` + sysin.DispatchLogInp +} + +type DispatchLogRes struct { + *sysin.DispatchLogModel +} diff --git a/server/api/admin/cron/cron_group.go b/server/api/admin/cron/cron_group.go new file mode 100644 index 0000000..fa20089 --- /dev/null +++ b/server/api/admin/cron/cron_group.go @@ -0,0 +1,83 @@ +// Package cron +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cron + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// GroupListReq 查询列表 +type GroupListReq struct { + g.Meta `path:"/cronGroup/list" method:"get" tags:"定时任务分组" summary:"获取定时任务分组列表"` + sysin.CronGroupListInp +} + +type GroupListRes struct { + List []*sysin.CronGroupListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// GroupViewReq 获取信息 +type GroupViewReq struct { + g.Meta `path:"/cronGroup/view" method:"get" tags:"定时任务分组" summary:"获取指定信息"` + sysin.CronGroupViewInp +} + +type GroupViewRes struct { + *sysin.CronGroupViewModel +} + +// GroupEditReq 修改/新增 +type GroupEditReq struct { + g.Meta `path:"/cronGroup/edit" method:"post" tags:"定时任务分组" summary:"修改/新增定时任务分组"` + sysin.CronGroupEditInp +} + +type GroupEditRes struct { + *sysin.CronGroupEditModel +} + +// GroupDeleteReq 删除 +type GroupDeleteReq struct { + g.Meta `path:"/cronGroup/delete" method:"post" tags:"定时任务分组" summary:"删除定时任务分组"` + sysin.CronGroupDeleteInp +} + +type GroupDeleteRes struct { + *sysin.CronGroupDeleteModel +} + +// GroupMaxSortReq 最大排序 +type GroupMaxSortReq struct { + g.Meta `path:"/cronGroup/maxSort" method:"get" tags:"定时任务分组" summary:"定时任务分组最大排序"` + sysin.CronGroupMaxSortInp +} + +type GroupMaxSortRes struct { + *sysin.CronGroupMaxSortModel +} + +// GroupStatusReq 更新状态 +type GroupStatusReq struct { + g.Meta `path:"/cronGroup/status" method:"post" tags:"定时任务分组" summary:"更新定时任务分组状态"` + sysin.CronGroupStatusInp +} + +type GroupStatusRes struct { + *sysin.CronGroupStatusModel +} + +// GroupSelectReq 定时任务分组选项 +type GroupSelectReq struct { + g.Meta `path:"/cronGroup/select" method:"get" tags:"定时任务分组" summary:"定时任务分组选项"` + sysin.CronGroupSelectInp +} + +type GroupSelectRes struct { + *sysin.CronGroupSelectModel +} diff --git a/server/api/admin/curddemo/curddemo.go b/server/api/admin/curddemo/curddemo.go new file mode 100644 index 0000000..f570d4f --- /dev/null +++ b/server/api/admin/curddemo/curddemo.go @@ -0,0 +1,85 @@ +// Package curddemo +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2025 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.18.6 +package curddemo + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +// ListReq 查询CURD列表列表 +type ListReq struct { + g.Meta `path:"/curdDemo/list" method:"get" tags:"CURD列表" summary:"获取CURD列表列表"` + sysin.CurdDemoListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.CurdDemoListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出CURD列表列表 +type ExportReq struct { + g.Meta `path:"/curdDemo/export" method:"get" tags:"CURD列表" summary:"导出CURD列表列表"` + sysin.CurdDemoListInp +} + +type ExportRes struct{} + +// ViewReq 获取CURD列表指定信息 +type ViewReq struct { + g.Meta `path:"/curdDemo/view" method:"get" tags:"CURD列表" summary:"获取CURD列表指定信息"` + sysin.CurdDemoViewInp +} + +type ViewRes struct { + *sysin.CurdDemoViewModel +} + +// EditReq 修改/新增CURD列表 +type EditReq struct { + g.Meta `path:"/curdDemo/edit" method:"post" tags:"CURD列表" summary:"修改/新增CURD列表"` + sysin.CurdDemoEditInp +} + +type EditRes struct{} + +// DeleteReq 删除CURD列表 +type DeleteReq struct { + g.Meta `path:"/curdDemo/delete" method:"post" tags:"CURD列表" summary:"删除CURD列表"` + sysin.CurdDemoDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 获取CURD列表最大排序 +type MaxSortReq struct { + g.Meta `path:"/curdDemo/maxSort" method:"get" tags:"CURD列表" summary:"获取CURD列表最大排序"` + sysin.CurdDemoMaxSortInp +} + +type MaxSortRes struct { + *sysin.CurdDemoMaxSortModel +} + +// StatusReq 更新CURD列表状态 +type StatusReq struct { + g.Meta `path:"/curdDemo/status" method:"post" tags:"CURD列表" summary:"更新CURD列表状态"` + sysin.CurdDemoStatusInp +} + +type StatusRes struct{} + +// SwitchReq 更新CURD列表开关状态 +type SwitchReq struct { + g.Meta `path:"/curdDemo/switch" method:"post" tags:"CURD列表" summary:"更新CURD列表状态"` + sysin.CurdDemoSwitchInp +} + +type SwitchRes struct{} \ No newline at end of file diff --git a/server/api/admin/customerservice/customerservice.go b/server/api/admin/customerservice/customerservice.go new file mode 100644 index 0000000..2ccbcd0 --- /dev/null +++ b/server/api/admin/customerservice/customerservice.go @@ -0,0 +1,38 @@ +package customerservice + +import ( + "hotgo/internal/model/entity" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +type ListReq struct { + g.Meta `path:"/customerService/list" method:"get" tags:"客服管理" summary:"客服列表"` + sysin.CustomerServiceListInp +} +type ListRes struct { + form.PageRes + List []*entity.CustomerService `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/customerService/view" method:"get" tags:"客服管理" summary:"客服详情"` + sysin.CustomerServiceViewInp +} +type ViewRes struct{ *entity.CustomerService } +type EditReq struct { + g.Meta `path:"/customerService/edit" method:"post" tags:"客服管理" summary:"新增编辑客服"` + sysin.CustomerServiceEditInp +} +type EditRes struct{} +type StatusReq struct { + g.Meta `path:"/customerService/status" method:"post" tags:"客服管理" summary:"客服启停"` + sysin.CustomerServiceStatusInp +} +type StatusRes struct{} +type DeleteReq struct { + g.Meta `path:"/customerService/delete" method:"post" tags:"客服管理" summary:"删除客服"` + sysin.CustomerServiceDeleteInp +} +type DeleteRes struct{} diff --git a/server/api/admin/dept/dept.go b/server/api/admin/dept/dept.go new file mode 100644 index 0000000..565ec74 --- /dev/null +++ b/server/api/admin/dept/dept.go @@ -0,0 +1,75 @@ +// Package dept +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package dept + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" + "hotgo/utility/tree" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/dept/list" method:"get" tags:"部门" summary:"获取部门列表"` + adminin.DeptListInp +} + +type ListRes *adminin.DeptListModel + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/dept/view" method:"get" tags:"部门" summary:"获取指定信息"` + adminin.DeptViewInp +} + +type ViewRes struct { + *adminin.DeptViewModel +} + +// EditReq 修改/新增字典数据 +type EditReq struct { + g.Meta `path:"/dept/edit" method:"post" tags:"部门" summary:"修改/新增部门"` + adminin.DeptEditInp +} + +type EditRes struct{} + +// DeleteReq 删除字典类型 +type DeleteReq struct { + g.Meta `path:"/dept/delete" method:"post" tags:"部门" summary:"删除部门"` + adminin.DeptDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/dept/maxSort" method:"get" tags:"部门" summary:"部门最大排序"` + adminin.DeptMaxSortInp +} + +type MaxSortRes struct { + *adminin.DeptMaxSortModel +} + +// OptionReq 获取当前登录用户可选的部门选项 +type OptionReq struct { + g.Meta `path:"/dept/option" method:"get" tags:"部门" summary:"获取当前登录用户可选的部门选项"` + adminin.DeptOptionInp +} + +type OptionRes struct { + *adminin.DeptOptionModel + form.PageRes +} + +// TreeOptionReq 获取部门关系树选项 +type TreeOptionReq struct { + g.Meta `path:"/dept/treeOption" method:"get" tags:"部门" summary:"获取部门关系树选项"` +} + +type TreeOptionRes []tree.Node diff --git a/server/api/admin/dict/dict_data.go b/server/api/admin/dict/dict_data.go new file mode 100644 index 0000000..8ecdea7 --- /dev/null +++ b/server/api/admin/dict/dict_data.go @@ -0,0 +1,53 @@ +// Package dict +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package dict + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// DataEditReq 修改/新增字典数据 +type DataEditReq struct { + g.Meta `path:"/dictData/edit" method:"post" tags:"字典数据" summary:"修改/新增字典数据"` + sysin.DictDataEditInp +} + +type DataEditRes struct{} + +// DataDeleteReq 删除字典数据 +type DataDeleteReq struct { + g.Meta `path:"/dictData/delete" method:"post" tags:"字典数据" summary:"删除字典数据"` + sysin.DictDataDeleteInp +} + +type DataDeleteRes struct{} + +// DataListReq 查询列表 +type DataListReq struct { + g.Meta `path:"/dictData/list" method:"get" tags:"字典数据" summary:"获取字典数据列表"` + sysin.DictDataListInp +} + +type DataListRes struct { + List []*sysin.DictDataListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +type DataSelectReq struct { + g.Meta `path:"/dictData/option/{Type}" method:"get" tags:"字典数据" summary:"获取指定字典选项"` + sysin.DataSelectInp +} + +type DataSelectRes sysin.DataSelectModel + +type DataSelectsReq struct { + g.Meta `path:"/dictData/options" method:"get" tags:"字典数据" summary:"获取多个字典选项"` + Types []string `json:"types"` +} + +type DataSelectsRes map[string]sysin.DataSelectModel diff --git a/server/api/admin/dict/dict_type.go b/server/api/admin/dict/dict_type.go new file mode 100644 index 0000000..16f09cb --- /dev/null +++ b/server/api/admin/dict/dict_type.go @@ -0,0 +1,36 @@ +// Package dict +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package dict + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/sysin" +) + +// TypeTreeReq 字典类型树 +type TypeTreeReq struct { + g.Meta `path:"/dictType/tree" tags:"字典类型" method:"get" summary:"字典类型树列表"` +} + +type TypeTreeRes struct { + List []*sysin.DictTypeTree `json:"list" dc:"数据列表"` +} + +// TypeEditReq 修改/新增字典数据 +type TypeEditReq struct { + g.Meta `path:"/dictType/edit" method:"post" tags:"字典类型" summary:"修改/新增字典类型"` + sysin.DictTypeEditInp +} + +type TypeEditRes struct{} + +// TypeDeleteReq 删除字典类型 +type TypeDeleteReq struct { + g.Meta `path:"/dictType/delete" method:"post" tags:"字典类型" summary:"删除字典类型"` + sysin.DictTypeDeleteInp +} + +type TypeDeleteRes struct{} diff --git a/server/api/admin/emslog/emslog.go b/server/api/admin/emslog/emslog.go new file mode 100644 index 0000000..3fd1578 --- /dev/null +++ b/server/api/admin/emslog/emslog.go @@ -0,0 +1,65 @@ +// Package emslog +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package emslog + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/emsLog/list" method:"get" tags:"邮件记录" summary:"获取邮件记录列表"` + sysin.EmsLogListInp +} + +type ListRes struct { + List []*sysin.EmsLogListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/emsLog/view" method:"get" tags:"邮件记录" summary:"获取指定信息"` + sysin.EmsLogViewInp +} + +type ViewRes struct { + *sysin.EmsLogViewModel +} + +// EditReq 修改/新增数据 +type EditReq struct { + g.Meta `path:"/emsLog/edit" method:"post" tags:"邮件记录" summary:"修改/新增邮件记录"` + sysin.EmsLogEditInp +} + +type EditRes struct{} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/emsLog/delete" method:"post" tags:"邮件记录" summary:"删除邮件记录"` + sysin.EmsLogDeleteInp +} + +type DeleteRes struct{} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/emsLog/status" method:"post" tags:"邮件记录" summary:"更新邮件记录状态"` + sysin.EmsLogStatusInp +} + +type StatusRes struct{} + +// SendTestReq 更新状态 +type SendTestReq struct { + g.Meta `path:"/emsLog/sendTest" method:"post" tags:"邮件记录" summary:"发送测试邮件"` + sysin.SendEmsInp +} + +type SendTestRes struct{} diff --git a/server/api/admin/gencodes/gencodes.go b/server/api/admin/gencodes/gencodes.go new file mode 100644 index 0000000..7b196c8 --- /dev/null +++ b/server/api/admin/gencodes/gencodes.go @@ -0,0 +1,118 @@ +// Package gencodes +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package gencodes + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/genCodes/list" method:"get" tags:"生成代码" summary:"获取生成代码列表"` + sysin.GenCodesListInp +} + +type ListRes struct { + List []*sysin.GenCodesListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/genCodes/view" method:"get" tags:"生成代码" summary:"获取指定信息"` + sysin.GenCodesViewInp +} + +type ViewRes struct { + *sysin.GenCodesViewModel +} + +// EditReq 修改/新增数据 +type EditReq struct { + g.Meta `path:"/genCodes/edit" method:"post" tags:"生成代码" summary:"修改/新增生成代码"` + sysin.GenCodesEditInp +} + +type EditRes struct { + *sysin.GenCodesEditModel +} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/genCodes/delete" method:"post" tags:"生成代码" summary:"删除生成代码"` + sysin.GenCodesDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/genCodes/maxSort" method:"get" tags:"生成代码" summary:"生成代码最大排序"` + sysin.GenCodesMaxSortInp +} + +type MaxSortRes struct { + *sysin.GenCodesMaxSortModel +} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/genCodes/status" method:"post" tags:"生成代码" summary:"更新生成代码状态"` + sysin.GenCodesStatusInp +} + +type StatusRes struct{} + +type SelectsReq struct { + g.Meta `path:"/genCodes/selects" method:"get" tags:"生成代码" summary:"生成入口选项"` + sysin.GenCodesSelectsInp +} + +type SelectsRes struct { + *sysin.GenCodesSelectsModel +} + +type TableSelectReq struct { + g.Meta `path:"/genCodes/tableSelect" method:"get" tags:"生成代码" summary:"数据库表选项"` + sysin.GenCodesTableSelectInp +} + +type TableSelectRes []*sysin.GenCodesTableSelectModel + +type ColumnSelectReq struct { + g.Meta `path:"/genCodes/columnSelect" method:"get" tags:"生成代码" summary:"表字段选项"` + sysin.GenCodesColumnSelectInp +} + +type ColumnSelectRes []*sysin.GenCodesColumnSelectModel + +type ColumnListReq struct { + g.Meta `path:"/genCodes/columnList" method:"get" tags:"生成代码" summary:"表字段列表"` + sysin.GenCodesColumnListInp +} + +type ColumnListRes []*sysin.GenCodesColumnListModel + +// PreviewReq 生成预览 +type PreviewReq struct { + g.Meta `path:"/genCodes/preview" method:"post" tags:"生成代码" summary:"生成预览"` + sysin.GenCodesPreviewInp +} + +type PreviewRes struct { + *sysin.GenCodesPreviewModel +} + +// BuildReq 提交生成 +type BuildReq struct { + g.Meta `path:"/genCodes/build" method:"post" tags:"生成代码" summary:"提交生成"` + sysin.GenCodesBuildInp +} + +type BuildRes struct { +} diff --git a/server/api/admin/log/log.go b/server/api/admin/log/log.go new file mode 100644 index 0000000..981751d --- /dev/null +++ b/server/api/admin/log/log.go @@ -0,0 +1,56 @@ +// Package log +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package log + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ClearReq 清空日志 +type ClearReq struct { + g.Meta `path:"/log/clear" method:"post" tags:"访问日志" summary:"清空日志"` +} + +type ClearRes struct{} + +// ExportReq 导出 +type ExportReq struct { + g.Meta `path:"/log/export" method:"get" tags:"访问日志" summary:"导出日志"` + sysin.LogListInp +} + +type ExportRes struct{} + +// ListReq 获取菜单列表 +type ListReq struct { + g.Meta `path:"/log/list" method:"get" tags:"访问日志" summary:"获取日志列表"` + sysin.LogListInp +} + +type ListRes struct { + List []*sysin.LogListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/log/delete" method:"post" tags:"访问日志" summary:"删除日志"` + sysin.LogDeleteInp +} + +type DeleteRes struct{} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/log/view" method:"get" tags:"访问日志" summary:"获取指定信息"` + sysin.LogViewInp +} + +type ViewRes struct { + *sysin.LogViewModel +} diff --git a/server/api/admin/loginlog/loginlog.go b/server/api/admin/loginlog/loginlog.go new file mode 100644 index 0000000..6fd3710 --- /dev/null +++ b/server/api/admin/loginlog/loginlog.go @@ -0,0 +1,39 @@ +// Package loginlog +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package loginlog + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询登录日志列表 +type ListReq struct { + g.Meta `path:"/loginLog/list" method:"get" tags:"登录日志" summary:"获取登录日志列表"` + sysin.LoginLogListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.LoginLogListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出登录日志列表 +type ExportReq struct { + g.Meta `path:"/loginLog/export" method:"get" tags:"登录日志" summary:"导出登录日志列表"` + sysin.LoginLogListInp +} + +type ExportRes struct{} + +// DeleteReq 删除登录日志 +type DeleteReq struct { + g.Meta `path:"/loginLog/delete" method:"post" tags:"登录日志" summary:"删除登录日志"` + sysin.LoginLogDeleteInp +} + +type DeleteRes struct{} diff --git a/server/api/admin/member/member.go b/server/api/admin/member/member.go new file mode 100644 index 0000000..49cd1f0 --- /dev/null +++ b/server/api/admin/member/member.go @@ -0,0 +1,138 @@ +// Package member +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package member + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// UpdateCashReq 更新提现信息 +type UpdateCashReq struct { + g.Meta `path:"/member/updateCash" method:"post" tags:"用户" summary:"更新提现信息"` + adminin.MemberUpdateCashInp +} + +type UpdateCashRes struct{} + +// UpdateEmailReq 换绑邮箱 +type UpdateEmailReq struct { + g.Meta `path:"/member/updateEmail" method:"post" tags:"用户" summary:"换绑邮箱"` + adminin.MemberUpdateEmailInp +} + +type UpdateEmailRes struct{} + +// UpdateMobileReq 换绑手机号 +type UpdateMobileReq struct { + g.Meta `path:"/member/updateMobile" method:"post" tags:"用户" summary:"换绑手机号"` + adminin.MemberUpdateMobileInp +} + +type UpdateMobileRes struct{} + +// UpdateProfileReq 更新用户资料 +type UpdateProfileReq struct { + g.Meta `path:"/member/updateProfile" method:"post" tags:"用户" summary:"更新用户资料"` + adminin.MemberUpdateProfileInp +} + +type UpdateProfileRes struct{} + +// UpdatePwdReq 修改登录密码 +type UpdatePwdReq struct { + g.Meta `path:"/member/updatePwd" method:"post" tags:"用户" summary:"重置密码"` + adminin.MemberUpdatePwdInp +} + +type UpdatePwdRes struct{} + +// ResetPwdReq 重置密码 +type ResetPwdReq struct { + g.Meta `path:"/member/resetPwd" method:"post" tags:"用户" summary:"重置密码"` + adminin.MemberResetPwdInp +} + +type ResetPwdRes struct{} + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/member/list" method:"get" tags:"用户" summary:"获取用户列表"` + adminin.MemberListInp +} + +type ListRes struct { + List []*adminin.MemberListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/member/view" method:"get" tags:"用户" summary:"获取指定信息"` + adminin.MemberViewInp +} + +type ViewRes struct { + *adminin.MemberViewModel +} + +// EditReq 修改/新增 +type EditReq struct { + g.Meta `path:"/member/edit" method:"post" tags:"用户" summary:"修改/新增用户"` + adminin.MemberEditInp +} + +type EditRes struct{} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/member/delete" method:"post" tags:"用户" summary:"删除用户"` + adminin.MemberDeleteInp +} + +type DeleteRes struct{} + +// StatusReq 更新用户状态 +type StatusReq struct { + g.Meta `path:"/member/status" method:"post" tags:"用户" summary:"更新用户状态"` + adminin.MemberStatusInp +} + +type StatusRes struct{} + +// SelectReq 获取可选的后台用户选项 +type SelectReq struct { + g.Meta `path:"/member/option" method:"get" tags:"用户" summary:"获取可选的后台用户选项"` + adminin.MemberSelectInp +} + +type SelectRes []*adminin.MemberSelectModel + +// InfoReq 获取登录用户信息 +type InfoReq struct { + g.Meta `path:"/member/info" method:"get" tags:"用户" summary:"获取登录用户信息"` +} + +type InfoRes struct { + *adminin.LoginMemberInfoModel +} + +// AddBalanceReq 增加余额 +type AddBalanceReq struct { + g.Meta `path:"/member/addBalance" method:"post" tags:"用户" summary:"增加余额"` + adminin.MemberAddBalanceInp +} + +type AddBalanceRes struct{} + +// AddIntegralReq 增加积分 +type AddIntegralReq struct { + g.Meta `path:"/member/addIntegral" method:"post" tags:"用户" summary:"增加积分"` + adminin.MemberAddIntegralInp +} + +type AddIntegralRes struct{} diff --git a/server/api/admin/memberlevel/memberlevel.go b/server/api/admin/memberlevel/memberlevel.go new file mode 100644 index 0000000..63f27f7 --- /dev/null +++ b/server/api/admin/memberlevel/memberlevel.go @@ -0,0 +1,67 @@ +package memberlevel + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +type ListReq struct { + g.Meta `path:"/memberLevel/list" method:"get" tags:"会员等级" summary:"会员等级列表"` + sysin.MemberLevelListInp +} +type ListRes struct { + form.PageRes + List []*sysin.MemberLevelListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/memberLevel/view" method:"get" tags:"会员等级" summary:"会员等级详情"` + sysin.MemberLevelViewInp +} +type ViewRes struct{ *sysin.MemberLevelViewModel } +type SaveReq struct { + g.Meta `path:"/memberLevel/save" method:"post" tags:"会员等级" summary:"保存等级规则草稿"` + sysin.MemberLevelSaveInp +} +type SaveRes struct { + Id uint64 `json:"id"` + VersionId uint64 `json:"versionId"` +} +type SubmitReq struct { + g.Meta `path:"/memberLevel/submit" method:"post" tags:"会员等级" summary:"提交等级规则审批"` + sysin.MemberLevelSubmitInp +} +type SubmitRes struct { + *sysin.MemberLevelApprovalModel +} +type PublishReq struct { + g.Meta `path:"/memberLevel/publish" method:"post" tags:"会员等级" summary:"发布已审批等级规则"` + sysin.MemberLevelPublishInp +} +type PublishRes struct{} +type RollbackReq struct { + g.Meta `path:"/memberLevel/rollback" method:"post" tags:"会员等级" summary:"回滚等级规则为新草稿"` + sysin.MemberLevelRollbackInp +} +type RollbackRes struct { + VersionId uint64 `json:"versionId"` +} +type HistoryReq struct { + g.Meta `path:"/memberLevel/history" method:"get" tags:"会员等级" summary:"等级版本历史"` + sysin.MemberLevelHistoryInp +} +type HistoryRes struct { + form.PageRes + List []*entity.AppMemberLevelVersion `json:"list"` +} +type StatusReq struct { + g.Meta `path:"/memberLevel/status" method:"post" tags:"会员等级" summary:"停用启用会员等级"` + sysin.MemberLevelStatusInp +} +type StatusRes struct{} +type DeleteReq struct { + g.Meta `path:"/memberLevel/delete" method:"post" tags:"会员等级" summary:"删除会员等级"` + sysin.MemberLevelDeleteInp +} +type DeleteRes struct{} diff --git a/server/api/admin/menu/menu.go b/server/api/admin/menu/menu.go new file mode 100644 index 0000000..45351da --- /dev/null +++ b/server/api/admin/menu/menu.go @@ -0,0 +1,39 @@ +// Package menu +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package menu + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// EditReq 修改/新增菜单 +type EditReq struct { + g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"` + adminin.MenuEditInp +} + +type EditRes struct{} + +// DeleteReq 删除菜单 +type DeleteReq struct { + g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"` + adminin.MenuDeleteInp +} + +type DeleteRes struct{} + +// ListReq 获取菜单列表 +type ListReq struct { + g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"` + adminin.MenuListInp +} + +type ListRes struct { + *adminin.MenuListModel + form.PageRes +} diff --git a/server/api/admin/monitor/monitor.go b/server/api/admin/monitor/monitor.go new file mode 100644 index 0000000..d86a812 --- /dev/null +++ b/server/api/admin/monitor/monitor.go @@ -0,0 +1,106 @@ +// Package monitor +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package monitor + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" + "hotgo/internal/library/network/tcp" + "hotgo/internal/model/input/form" +) + +// UserOfflineReq 下线用户 +type UserOfflineReq struct { + g.Meta `path:"/monitor/userOffline" method:"post" tags:"在线用户" summary:"下线用户"` + Id string `json:"id" v:"required#SID不能为空" description:"SID"` +} + +type UserOfflineRes struct{} + +// UserOnlineListReq 获取在线用户列表 +type UserOnlineListReq struct { + g.Meta `path:"/monitor/userOnlineList" method:"get" tags:"在线用户" summary:"获取在线用户列表"` + form.PageReq + UserId int64 `json:"userId" description:"用户ID"` + Username string `json:"username" description:"用户名"` + IP string `json:"ip" description:"登录IP"` + FirstTime []*gtime.Time `json:"firstTime" description:"登录时间"` +} + +type UserOnlineListRes struct { + List []*UserOnlineModel `json:"list" description:"数据列表"` + form.PageRes +} + +type UserOnlineModel struct { + ID string `json:"id"` // 连接唯一标识 + IP string `json:"ip"` // 客户端IP + Os string `json:"os"` // 客户端系统名称 + Browser string `json:"browser"` // 浏览器 + FirstTime int64 `json:"firstTime"` // 首次连接时间 + HeartbeatTime uint64 `json:"heartbeatTime"` // 用户上次心跳时间 + App string `json:"app"` // 应用名称 + UserId int64 `json:"userId"` // 用户ID + Username string `json:"username"` // 用户名 + Avatar string `json:"avatar"` // 头像 +} + +// NetOnlineListReq 获取在线服务列表 +type NetOnlineListReq struct { + g.Meta `path:"/monitor/netOnlineList" method:"get" tags:"在线服务" summary:"获取在线服务列表"` + form.PageReq + Name string `json:"name" description:"应用名称"` + Group string `json:"group" description:"分组"` + AppId string `json:"appId" description:"APPID"` + Addr string `json:"addr" description:"登录地址"` + FirstTime []*gtime.Time `json:"firstTime" description:"登录时间"` +} + +type NetOnlineListRes struct { + List []*NetOnlineModel `json:"list" description:"数据列表"` + form.PageRes +} + +type NetOnlineModel struct { + *tcp.AuthMeta + Id int64 `json:"id" description:"连接ID"` + IsAuth bool `json:"isAuth" description:"是否认证"` + Addr string `json:"addr" description:"登录地址"` + Port string `json:"port" description:"连接端口"` + FirstTime int64 `json:"firstTime" description:"首次连接时间"` + HeartbeatTime int64 `json:"heartbeatTime" description:"上次心跳时间"` + LicenseId int64 `json:"licenseId" description:"许可ID"` + LicenseName string `json:"licenseName" description:"许可名称"` + LoginTimes int64 `json:"loginTimes" description:"许可累计登录次数"` + Online int `json:"online" description:"许可在线数量"` + OnlineLimit int `json:"onlineLimit" description:"许可在线数量限制"` + Desc string `json:"desc" description:"许可说明"` + Proto string `json:"proto" description:"网络协议"` +} + +// NetOptionReq 获取服务选项 +type NetOptionReq struct { + g.Meta `path:"/monitor/netOption" method:"get" tags:"在线服务" summary:"获取服务选项"` +} + +type NetOptionRes struct { + Routes []*RouteSelect `json:"routes" dc:"路由选项"` +} + +type RouteSelect struct { + Value interface{} `json:"value"` + Label string `json:"label"` + Disabled bool `json:"disabled"` + IsRPC bool `json:"isRPC"` +} + +// NetOfflineReq 下线服务 +type NetOfflineReq struct { + g.Meta `path:"/monitor/netOffline" method:"post" tags:"在线服务" summary:"下线服务"` + Id int64 `json:"id" v:"required#连接ID不能为空" description:"连接ID"` +} + +type NetOfflineRes struct{} diff --git a/server/api/admin/normaltreedemo/normaltreedemo.go b/server/api/admin/normaltreedemo/normaltreedemo.go new file mode 100644 index 0000000..62dff51 --- /dev/null +++ b/server/api/admin/normaltreedemo/normaltreedemo.go @@ -0,0 +1,69 @@ +// Package normaltreedemo +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.15.7 +package normaltreedemo + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + "hotgo/utility/tree" + + "github.com/gogf/gf/v2/frame/g" +) + +// ListReq 查询普通树表列表 +type ListReq struct { + g.Meta `path:"/normalTreeDemo/list" method:"get" tags:"普通树表" summary:"获取普通树表列表"` + sysin.NormalTreeDemoListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.NormalTreeDemoListModel `json:"list" dc:"数据列表"` +} + +// ViewReq 获取普通树表指定信息 +type ViewReq struct { + g.Meta `path:"/normalTreeDemo/view" method:"get" tags:"普通树表" summary:"获取普通树表指定信息"` + sysin.NormalTreeDemoViewInp +} + +type ViewRes struct { + *sysin.NormalTreeDemoViewModel +} + +// EditReq 修改/新增普通树表 +type EditReq struct { + g.Meta `path:"/normalTreeDemo/edit" method:"post" tags:"普通树表" summary:"修改/新增普通树表"` + sysin.NormalTreeDemoEditInp +} + +type EditRes struct{} + +// DeleteReq 删除普通树表 +type DeleteReq struct { + g.Meta `path:"/normalTreeDemo/delete" method:"post" tags:"普通树表" summary:"删除普通树表"` + sysin.NormalTreeDemoDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 获取普通树表最大排序 +type MaxSortReq struct { + g.Meta `path:"/normalTreeDemo/maxSort" method:"get" tags:"普通树表" summary:"获取普通树表最大排序"` + sysin.NormalTreeDemoMaxSortInp +} + +type MaxSortRes struct { + *sysin.NormalTreeDemoMaxSortModel +} + +// TreeOptionReq 获取普通树表关系树选项 +type TreeOptionReq struct { + g.Meta `path:"/normalTreeDemo/treeOption" method:"get" tags:"普通树表" summary:"获取普通树表关系树选项"` +} + +type TreeOptionRes []tree.Node diff --git a/server/api/admin/notice/notice.go b/server/api/admin/notice/notice.go new file mode 100644 index 0000000..75232df --- /dev/null +++ b/server/api/admin/notice/notice.go @@ -0,0 +1,128 @@ +// Package notice +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package notice + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/notice/list" method:"get" tags:"公告" summary:"获取公告列表"` + adminin.NoticeListInp +} + +type ListRes struct { + List []*adminin.NoticeListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/notice/view" method:"get" tags:"公告" summary:"获取指定信息"` + adminin.NoticeViewInp +} + +type ViewRes struct { + *adminin.NoticeViewModel +} + +// EditReq 修改/新增字典数据 +type EditReq struct { + g.Meta `path:"/notice/edit" method:"post" tags:"公告" summary:"修改/新增公告"` + adminin.NoticeEditInp +} + +type EditRes struct{} + +// DeleteReq 删除字典类型 +type DeleteReq struct { + g.Meta `path:"/notice/delete" method:"post" tags:"公告" summary:"删除公告"` + adminin.NoticeDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/notice/maxSort" method:"get" tags:"公告" summary:"公告最大排序"` + adminin.NoticeMaxSortInp +} + +type MaxSortRes struct { + *adminin.NoticeMaxSortModel +} + +// StatusReq 更新公告状态 +type StatusReq struct { + g.Meta `path:"/notice/status" method:"post" tags:"公告" summary:"更新公告状态"` + adminin.NoticeStatusInp +} + +type StatusRes struct{} + +// EditNotifyReq 修改/新增通知 +type EditNotifyReq struct { + g.Meta `path:"/notice/editNotify" method:"post" tags:"公告" summary:"修改/新增通知"` + adminin.NoticeEditInp +} + +type EditNotifyRes struct{} + +// EditNoticeReq 修改/新增公告 +type EditNoticeReq struct { + g.Meta `path:"/notice/editNotice" method:"post" tags:"公告" summary:"修改/新增公告"` + adminin.NoticeEditInp +} + +type EditNoticeRes struct{} + +// EditLetterReq 修改/新增公告 +type EditLetterReq struct { + g.Meta `path:"/notice/editLetter" method:"post" tags:"公告" summary:"修改/新增私信"` + adminin.NoticeEditInp +} + +type EditLetterRes struct{} + +// PullMessagesReq 拉取我的消息 +type PullMessagesReq struct { + g.Meta `path:"/notice/pullMessages" method:"get" tags:"公告" summary:"拉取我的消息"` + adminin.PullMessagesInp +} + +type PullMessagesRes struct { + *adminin.PullMessagesModel +} + +// ReadAllReq 全部已读 +type ReadAllReq struct { + g.Meta `path:"/notice/readAll" method:"post" tags:"公告" summary:"全部已读"` + adminin.NoticeReadAllInp +} + +type ReadAllRes struct { +} + +// UpReadReq 更新已读 +type UpReadReq struct { + g.Meta `path:"/notice/upRead" method:"post" tags:"公告" summary:"更新已读"` + adminin.NoticeUpReadInp +} +type UpReadRes struct{} + +// MessageListReq 我的消息列表 +type MessageListReq struct { + g.Meta `path:"/notice/messageList" method:"get" tags:"公告" summary:"我的消息列表"` + adminin.NoticeMessageListInp +} + +type MessageListRes struct { + List []*adminin.NoticeMessageListModel `json:"list" dc:"数据列表"` + form.PageRes +} diff --git a/server/api/admin/optiontreedemo/optiontreedemo.go b/server/api/admin/optiontreedemo/optiontreedemo.go new file mode 100644 index 0000000..70d0c63 --- /dev/null +++ b/server/api/admin/optiontreedemo/optiontreedemo.go @@ -0,0 +1,69 @@ +// Package optiontreedemo +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2025 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.17.8 +package optiontreedemo + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + "hotgo/utility/tree" + + "github.com/gogf/gf/v2/frame/g" +) + +// ListReq 查询选项树表列表 +type ListReq struct { + g.Meta `path:"/optionTreeDemo/list" method:"get" tags:"选项树表" summary:"获取选项树表列表"` + sysin.OptionTreeDemoListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.OptionTreeDemoListModel `json:"list" dc:"数据列表"` +} + +// ViewReq 获取选项树表指定信息 +type ViewReq struct { + g.Meta `path:"/optionTreeDemo/view" method:"get" tags:"选项树表" summary:"获取选项树表指定信息"` + sysin.OptionTreeDemoViewInp +} + +type ViewRes struct { + *sysin.OptionTreeDemoViewModel +} + +// EditReq 修改/新增选项树表 +type EditReq struct { + g.Meta `path:"/optionTreeDemo/edit" method:"post" tags:"选项树表" summary:"修改/新增选项树表"` + sysin.OptionTreeDemoEditInp +} + +type EditRes struct{} + +// DeleteReq 删除选项树表 +type DeleteReq struct { + g.Meta `path:"/optionTreeDemo/delete" method:"post" tags:"选项树表" summary:"删除选项树表"` + sysin.OptionTreeDemoDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 获取选项树表最大排序 +type MaxSortReq struct { + g.Meta `path:"/optionTreeDemo/maxSort" method:"get" tags:"选项树表" summary:"获取选项树表最大排序"` + sysin.OptionTreeDemoMaxSortInp +} + +type MaxSortRes struct { + *sysin.OptionTreeDemoMaxSortModel +} + +// TreeOptionReq 获取选项树表关系树选项 +type TreeOptionReq struct { + g.Meta `path:"/optionTreeDemo/treeOption" method:"get" tags:"选项树表" summary:"获取选项树表关系树选项"` +} + +type TreeOptionRes []tree.Node \ No newline at end of file diff --git a/server/api/admin/order/order.go b/server/api/admin/order/order.go new file mode 100644 index 0000000..425921f --- /dev/null +++ b/server/api/admin/order/order.go @@ -0,0 +1,93 @@ +// Package order +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package order + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// AcceptRefundReq 受理申请退款 +type AcceptRefundReq struct { + g.Meta `path:"/order/acceptRefund" method:"post" tags:"充值订单" summary:"受理申请退款"` + adminin.OrderAcceptRefundInp +} + +type AcceptRefundRes struct { +} + +// ApplyRefundReq 申请退款 +type ApplyRefundReq struct { + g.Meta `path:"/order/applyRefund" method:"post" tags:"充值订单" summary:"申请退款"` + adminin.OrderApplyRefundInp +} + +type ApplyRefundRes struct { +} + +// CreateReq 创建充值订单 +type CreateReq struct { + g.Meta `path:"/order/create" method:"post" tags:"充值订单" summary:"创建充值订单"` + adminin.OrderCreateInp +} + +type CreateRes struct { + *adminin.OrderCreateModel +} + +// ListReq 查询充值订单列表 +type ListReq struct { + g.Meta `path:"/order/list" method:"get" tags:"充值订单" summary:"获取充值订单列表"` + adminin.OrderListInp +} + +type ListRes struct { + form.PageRes + List []*adminin.OrderListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出充值订单列表 +type ExportReq struct { + g.Meta `path:"/order/export" method:"get" tags:"充值订单" summary:"导出充值订单列表"` + adminin.OrderListInp +} + +type ExportRes struct{} + +// ViewReq 获取充值订单指定信息 +type ViewReq struct { + g.Meta `path:"/order/view" method:"get" tags:"充值订单" summary:"获取充值订单指定信息"` + adminin.OrderViewInp +} + +type ViewRes struct { + *adminin.OrderViewModel +} + +// EditReq 修改/新增充值订单 +type EditReq struct { + g.Meta `path:"/order/edit" method:"post" tags:"充值订单" summary:"修改/新增充值订单"` + adminin.OrderEditInp +} + +type EditRes struct{} + +// DeleteReq 删除充值订单 +type DeleteReq struct { + g.Meta `path:"/order/delete" method:"post" tags:"充值订单" summary:"删除充值订单"` + adminin.OrderDeleteInp +} + +type DeleteRes struct{} + +// StatusReq 更新充值订单状态 +type StatusReq struct { + g.Meta `path:"/order/status" method:"post" tags:"充值订单" summary:"更新充值订单状态"` + adminin.OrderStatusInp +} + +type StatusRes struct{} diff --git a/server/api/admin/pay/refund.go b/server/api/admin/pay/refund.go new file mode 100644 index 0000000..dfbab3b --- /dev/null +++ b/server/api/admin/pay/refund.go @@ -0,0 +1,33 @@ +// Package pay +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.5.3 +// @AutoGenerate Date 2023-04-15 15:59:58 +package pay + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/payin" +) + +// RefundListReq 查询交易退款列表 +type RefundListReq struct { + g.Meta `path:"/payRefund/list" method:"get" tags:"交易退款" summary:"获取交易退款列表"` + payin.PayRefundListInp +} + +type RefundListRes struct { + form.PageRes + List []*payin.PayRefundListModel `json:"list" dc:"数据列表"` +} + +// RefundExportReq 导出交易退款列表 +type RefundExportReq struct { + g.Meta `path:"/payRefund/export" method:"get" tags:"交易退款" summary:"导出交易退款列表"` + payin.PayRefundListInp +} + +type RefundExportRes struct{} diff --git a/server/api/admin/portal/portal.go b/server/api/admin/portal/portal.go new file mode 100644 index 0000000..a09ac78 --- /dev/null +++ b/server/api/admin/portal/portal.go @@ -0,0 +1,144 @@ +package portal + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +type SiteConfigCurrentReq struct { + g.Meta `path:"/siteConfig/current" method:"get" tags:"门户管理" summary:"获取当前站点配置"` + sysin.SiteConfigCurrentInp +} +type SiteConfigCurrentRes struct{ *sysin.SiteConfigCurrentModel } +type SiteConfigHistoryReq struct { + g.Meta `path:"/siteConfig/history" method:"get" tags:"门户管理" summary:"获取站点配置版本"` + sysin.SiteConfigHistoryInp +} +type SiteConfigHistoryRes struct { + form.PageRes + List []*sysin.SiteConfigHistoryModel `json:"list"` +} +type SiteConfigSaveReq struct { + g.Meta `path:"/siteConfig/save" method:"post" tags:"门户管理" summary:"保存并立即生效站点配置"` + sysin.SiteConfigSaveInp +} +type SiteConfigSaveRes struct { + Id uint64 `json:"id"` +} +type SiteConfigSubmitReq struct { + g.Meta `path:"/siteConfig/submit" method:"post" tags:"门户管理" summary:"提交站点配置审批"` + sysin.SiteConfigSubmitInp +} +type SiteConfigSubmitRes struct{ *sysin.PortalApprovalModel } +type SiteConfigPublishReq struct { + g.Meta `path:"/siteConfig/publish" method:"post" tags:"门户管理" summary:"发布已审批站点配置"` + sysin.SiteConfigPublishInp +} +type SiteConfigPublishRes struct{} +type SiteConfigRollbackReq struct { + g.Meta `path:"/siteConfig/rollback" method:"post" tags:"门户管理" summary:"回滚站点配置"` + sysin.SiteConfigRollbackInp +} +type SiteConfigRollbackRes struct { + Id uint64 `json:"id"` +} + +type ContentListReq struct { + g.Meta `path:"/portalContent/list" method:"get" tags:"文本管理" summary:"获取文本内容列表"` + sysin.ContentListInp +} +type ContentListRes struct { + form.PageRes + List []*sysin.ContentListModel `json:"list"` +} +type ContentViewReq struct { + g.Meta `path:"/portalContent/view" method:"get" tags:"文本管理" summary:"获取文本内容详情"` + sysin.ContentViewInp +} +type ContentViewRes struct{ *sysin.ContentViewModel } +type ContentEditReq struct { + g.Meta `path:"/portalContent/edit" method:"post" tags:"文本管理" summary:"新增或编辑文本内容"` + sysin.ContentEditInp +} +type ContentEditRes struct { + Id uint64 `json:"id"` +} +type ContentDeleteReq struct { + g.Meta `path:"/portalContent/delete" method:"post" tags:"文本管理" summary:"删除或下线文本内容"` + sysin.ContentDeleteInp +} +type ContentDeleteRes struct{} +type ContentPublishReq struct { + g.Meta `path:"/portalContent/publish" method:"post" tags:"文本管理" summary:"发布文本内容版本"` + sysin.ContentPublishInp +} +type ContentPublishRes struct{} +type ContentOfflineReq struct { + g.Meta `path:"/portalContent/offline" method:"post" tags:"文本管理" summary:"下线文本内容"` + sysin.ContentOfflineInp +} +type ContentOfflineRes struct{} + +type BannerListReq struct { + g.Meta `path:"/banner/list" method:"get" tags:"Banner管理" summary:"获取Banner列表"` + sysin.BannerListInp +} +type BannerListRes struct { + form.PageRes + List []*sysin.BannerListModel `json:"list"` +} +type BannerViewReq struct { + g.Meta `path:"/banner/view" method:"get" tags:"Banner管理" summary:"获取Banner详情"` + sysin.BannerViewInp +} +type BannerViewRes struct{ *entity.Banner } +type BannerEditReq struct { + g.Meta `path:"/banner/edit" method:"post" tags:"Banner管理" summary:"新增或编辑Banner"` + sysin.BannerEditInp +} +type BannerEditRes struct { + Id uint64 `json:"id"` +} +type BannerDeleteReq struct { + g.Meta `path:"/banner/delete" method:"post" tags:"Banner管理" summary:"删除或下线Banner"` + sysin.BannerDeleteInp +} +type BannerDeleteRes struct{} +type BannerStatusReq struct { + g.Meta `path:"/banner/status" method:"post" tags:"Banner管理" summary:"更新Banner发布状态"` + sysin.BannerStatusInp +} +type BannerStatusRes struct{} + +type ManualProductListReq struct { + g.Meta `path:"/manualProduct/list" method:"get" tags:"手工商城" summary:"获取手工商城商品"` + sysin.ManualProductListInp +} +type ManualProductListRes struct { + form.PageRes + List []*sysin.ManualProductListModel `json:"list"` +} +type ManualProductViewReq struct { + g.Meta `path:"/manualProduct/view" method:"get" tags:"手工商城" summary:"获取手工商城商品详情"` + sysin.ManualProductViewInp +} +type ManualProductViewRes struct{ *sysin.ManualProductViewModel } +type ManualProductEditReq struct { + g.Meta `path:"/manualProduct/edit" method:"post" tags:"手工商城" summary:"新增或编辑手工商城商品"` + sysin.ManualProductEditInp +} +type ManualProductEditRes struct { + Id uint64 `json:"id"` +} +type ManualProductDeleteReq struct { + g.Meta `path:"/manualProduct/delete" method:"post" tags:"手工商城" summary:"删除或下线手工商城商品"` + sysin.ManualProductDeleteInp +} +type ManualProductDeleteRes struct{} +type ManualProductStatusReq struct { + g.Meta `path:"/manualProduct/status" method:"post" tags:"手工商城" summary:"更新手工商城商品状态"` + sysin.ManualProductStatusInp +} +type ManualProductStatusRes struct{} diff --git a/server/api/admin/post/post.go b/server/api/admin/post/post.go new file mode 100644 index 0000000..e0659a6 --- /dev/null +++ b/server/api/admin/post/post.go @@ -0,0 +1,67 @@ +// Package post +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package post + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// EditReq 修改/新增岗位 +type EditReq struct { + g.Meta `path:"/post/edit" method:"post" tags:"岗位" summary:"修改/新增岗位"` + adminin.PostEditInp +} + +type EditRes struct{} + +// DeleteReq 删除岗位 +type DeleteReq struct { + g.Meta `path:"/post/delete" method:"post" tags:"岗位" summary:"删除岗位"` + adminin.PostDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/post/maxSort" method:"get" tags:"岗位" summary:"岗位最大排序"` + adminin.PostMaxSortInp +} + +type MaxSortRes struct { + *adminin.PostMaxSortModel +} + +// ListReq 获取列表 +type ListReq struct { + g.Meta `path:"/post/list" method:"get" tags:"岗位" summary:"获取岗位列表"` + adminin.PostListInp +} + +type ListRes struct { + List []*adminin.PostListModel `json:"list" description:"数据列表"` + form.PageRes +} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/post/view" method:"get" tags:"岗位" summary:"获取指定信息"` + adminin.PostViewInp +} + +type ViewRes struct { + *adminin.PostViewModel +} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/post/status" method:"post" tags:"岗位" summary:"更新岗位状态"` + adminin.PostStatusInp +} + +type StatusRes struct{} diff --git a/server/api/admin/product/product.go b/server/api/admin/product/product.go new file mode 100644 index 0000000..0f6c176 --- /dev/null +++ b/server/api/admin/product/product.go @@ -0,0 +1,43 @@ +package product + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +type ListReq struct { + g.Meta `path:"/product/list" method:"get" tags:"商品管理" summary:"获取商品列表"` + sysin.ProductListInp +} +type ListRes struct { + form.PageRes + List []*sysin.ProductListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/product/view" method:"get" tags:"商品管理" summary:"获取商品详情"` + sysin.ProductViewInp +} +type ViewRes struct{ *sysin.ProductListModel } +type EditReq struct { + g.Meta `path:"/product/edit" method:"post" tags:"商品管理" summary:"新增编辑商品"` + sysin.ProductEditInp +} +type EditRes struct { + Id uint64 `json:"id"` +} +type StatusReq struct { + g.Meta `path:"/product/status" method:"post" tags:"商品管理" summary:"商品上下架"` + sysin.ProductStatusInp +} +type StatusRes struct{} +type RecommendReq struct { + g.Meta `path:"/product/recommend" method:"post" tags:"商品管理" summary:"商品推荐切换"` + sysin.ProductRecommendInp +} +type RecommendRes struct{} +type DeleteReq struct { + g.Meta `path:"/product/delete" method:"post" tags:"商品管理" summary:"删除商品"` + sysin.ProductDeleteInp +} +type DeleteRes struct{} diff --git a/server/api/admin/provinces/provinces.go b/server/api/admin/provinces/provinces.go new file mode 100644 index 0000000..d6bc9fd --- /dev/null +++ b/server/api/admin/provinces/provinces.go @@ -0,0 +1,115 @@ +// Package provinces +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package provinces + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/provinces/list" method:"get" tags:"省市区" summary:"获取省市区列表"` + sysin.ProvincesListInp +} + +type ListRes struct { + List []*sysin.ProvincesListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取信息 +type ViewReq struct { + g.Meta `path:"/provinces/view" method:"get" tags:"省市区" summary:"获取指定信息"` + sysin.ProvincesViewInp +} + +type ViewRes struct { + *sysin.ProvincesViewModel +} + +// EditReq 修改/新增 +type EditReq struct { + g.Meta `path:"/provinces/edit" method:"post" tags:"省市区" summary:"修改/新增省市区"` + sysin.ProvincesEditInp +} + +type EditRes struct{} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/provinces/delete" method:"post" tags:"省市区" summary:"删除省市区"` + sysin.ProvincesDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 最大排序 +type MaxSortReq struct { + g.Meta `path:"/provinces/maxSort" method:"get" tags:"省市区" summary:"省市区最大排序"` + sysin.ProvincesMaxSortInp +} + +type MaxSortRes struct { + *sysin.ProvincesMaxSortModel +} + +// StatusReq 更新状态 +type StatusReq struct { + g.Meta `path:"/provinces/status" method:"post" tags:"省市区" summary:"更新省市区状态"` + sysin.ProvincesStatusInp +} + +type StatusRes struct{} + +// TreeReq 关系树选项列表 +type TreeReq struct { + g.Meta `path:"/provinces/tree" tags:"省市区" method:"get" summary:"省市区关系树选项列表"` +} + +type TreeRes struct { + List []*sysin.ProvincesTree `json:"list" dc:"数据列表"` +} + +// ChildrenListReq 获取省市区下级列表 +type ChildrenListReq struct { + g.Meta `path:"/provinces/childrenList" method:"get" tags:"省市区" summary:"获取省市区下级列表"` + sysin.ProvincesChildrenListInp +} + +type ChildrenListRes struct { + List []*sysin.ProvincesChildrenListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// UniqueIdReq 地区ID是否唯一 +type UniqueIdReq struct { + g.Meta `path:"/provinces/uniqueId" method:"get" tags:"省市区" summary:"地区ID是否唯一"` + sysin.ProvincesUniqueIdInp +} + +type UniqueIdRes struct { + *sysin.ProvincesUniqueIdModel +} + +// SelectReq 省市区选项 +type SelectReq struct { + g.Meta `path:"/provinces/select" method:"get" tags:"省市区" summary:"省市区选项"` + sysin.ProvincesSelectInp +} + +type SelectRes struct { + *sysin.ProvincesSelectModel +} + +// CityLabelReq 获取指定城市标签 +type CityLabelReq struct { + g.Meta `path:"/provinces/cityLabel" method:"get" tags:"省市区" summary:"获取指定城市标签" ` + sysin.ProvincesCityLabelInp +} + +type CityLabelRes sysin.ProvincesCityLabelModel diff --git a/server/api/admin/rechargeorder/rechargeorder.go b/server/api/admin/rechargeorder/rechargeorder.go new file mode 100644 index 0000000..6debeee --- /dev/null +++ b/server/api/admin/rechargeorder/rechargeorder.go @@ -0,0 +1,37 @@ +package rechargeorder + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +type ListReq struct { + g.Meta `path:"/rechargeOrder/list" method:"get" tags:"充值管理" summary:"充值订单列表"` + sysin.RechargeOrderListInp +} +type ListRes struct { + form.PageRes + List []*sysin.RechargeOrderListModel `json:"list"` +} +type SummaryReq struct { + g.Meta `path:"/rechargeOrder/summary" method:"get" tags:"充值管理" summary:"充值金额汇总"` + sysin.RechargeOrderListInp +} +type SummaryRes struct{ *sysin.RechargeSummaryModel } +type ViewReq struct { + g.Meta `path:"/rechargeOrder/view" method:"get" tags:"充值管理" summary:"充值订单详情"` + sysin.RechargeOrderViewInp +} +type ViewRes struct{ *sysin.RechargeOrderListModel } +type ReviewReq struct { + g.Meta `path:"/rechargeOrder/review" method:"post" tags:"充值管理" summary:"提交充值审核"` + sysin.RechargeReviewInp +} +type ReviewRes struct{ *sysin.FinanceApprovalModel } +type ExecuteReq struct { + g.Meta `path:"/rechargeOrder/execute" method:"post" tags:"充值管理" summary:"执行已审批充值结果"` + sysin.FinanceExecuteInp +} +type ExecuteRes struct{} diff --git a/server/api/admin/role/role.go b/server/api/admin/role/role.go new file mode 100644 index 0000000..bbae5a1 --- /dev/null +++ b/server/api/admin/role/role.go @@ -0,0 +1,82 @@ +// Package role +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package role + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/consts" + "hotgo/internal/model/input/adminin" + "hotgo/internal/model/input/form" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/role/list" method:"get" tags:"角色" summary:"获取角色列表"` + adminin.RoleListInp +} + +type ListRes struct { + *adminin.RoleListModel + form.PageRes +} + +// DynamicReq 动态路由 +type DynamicReq struct { + g.Meta `path:"/role/dynamic" method:"get" tags:"角色" summary:"获取动态路由" description:"获取登录用户动态路由"` +} + +type DynamicRes struct { + List []*adminin.MenuRoute `json:"list" description:"数据列表"` +} + +type UpdatePermissionsReq struct { + g.Meta `path:"/role/updatePermissions" method:"post" tags:"角色" summary:"编辑角色菜单权限"` + adminin.UpdatePermissionsInp +} + +type UpdatePermissionsRes struct{} + +type GetPermissionsReq struct { + g.Meta `path:"/role/getPermissions" method:"get" tags:"角色" summary:"获取指定角色权限"` + adminin.GetPermissionsInp +} + +type GetPermissionsRes struct { + *adminin.GetPermissionsModel +} + +// EditReq 修改/新增角色 +type EditReq struct { + g.Meta `path:"/role/edit" method:"post" tags:"角色" summary:"修改/新增角色"` + adminin.RoleEditInp +} + +type EditRes struct{} + +// DeleteReq 删除角色 +type DeleteReq struct { + g.Meta `path:"/role/delete" method:"post" tags:"角色" summary:"删除角色"` + adminin.RoleDeleteInp +} + +type DeleteRes struct{} + +// DataScopeSelectReq 获取数据权限选项 +type DataScopeSelectReq struct { + g.Meta `path:"/role/dataScope/select" method:"get" tags:"角色" summary:"获取数据权限选项"` +} + +type DataScopeSelectRes struct { + List []consts.GroupScopeSelect `json:"list" dc:"数据选项"` +} + +// DataScopeEditReq 修改指定角色的数据权限 +type DataScopeEditReq struct { + g.Meta `path:"/role/dataScope/edit" method:"post" tags:"角色" summary:"修改指定角色的数据权限"` + adminin.DataScopeEditInp +} + +type DataScopeEditRes struct{} diff --git a/server/api/admin/servelicense/servelicense.go b/server/api/admin/servelicense/servelicense.go new file mode 100644 index 0000000..78c7f20 --- /dev/null +++ b/server/api/admin/servelicense/servelicense.go @@ -0,0 +1,74 @@ +// Package servelicense +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.7.6 +package servelicense + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询服务许可证列表 +type ListReq struct { + g.Meta `path:"/serveLicense/list" method:"get" tags:"服务许可证" summary:"获取服务许可证列表"` + sysin.ServeLicenseListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.ServeLicenseListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出服务许可证列表 +type ExportReq struct { + g.Meta `path:"/serveLicense/export" method:"get" tags:"服务许可证" summary:"导出服务许可证列表"` + sysin.ServeLicenseListInp +} + +type ExportRes struct{} + +// ViewReq 获取服务许可证指定信息 +type ViewReq struct { + g.Meta `path:"/serveLicense/view" method:"get" tags:"服务许可证" summary:"获取服务许可证指定信息"` + sysin.ServeLicenseViewInp +} + +type ViewRes struct { + *sysin.ServeLicenseViewModel +} + +// EditReq 修改/新增服务许可证 +type EditReq struct { + g.Meta `path:"/serveLicense/edit" method:"post" tags:"服务许可证" summary:"修改/新增服务许可证"` + sysin.ServeLicenseEditInp +} + +type EditRes struct{} + +// DeleteReq 删除服务许可证 +type DeleteReq struct { + g.Meta `path:"/serveLicense/delete" method:"post" tags:"服务许可证" summary:"删除服务许可证"` + sysin.ServeLicenseDeleteInp +} + +type DeleteRes struct{} + +// StatusReq 更新服务许可证状态 +type StatusReq struct { + g.Meta `path:"/serveLicense/status" method:"post" tags:"服务许可证" summary:"更新服务许可证状态"` + sysin.ServeLicenseStatusInp +} + +type StatusRes struct{} + +// AssignRouterReq 分配服务许可证路由 +type AssignRouterReq struct { + g.Meta `path:"/serveLicense/assignRouter" method:"post" tags:"服务许可证" summary:"分配服务许可证路由"` + sysin.ServeLicenseAssignRouterInp +} + +type AssignRouterRes struct{} diff --git a/server/api/admin/servelog/servelog.go b/server/api/admin/servelog/servelog.go new file mode 100644 index 0000000..d250cd1 --- /dev/null +++ b/server/api/admin/servelog/servelog.go @@ -0,0 +1,49 @@ +// Package servelog +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package servelog + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询服务日志列表 +type ListReq struct { + g.Meta `path:"/serveLog/list" method:"get" tags:"服务日志" summary:"获取服务日志列表"` + sysin.ServeLogListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.ServeLogListModel `json:"list" dc:"数据列表"` +} + +// ExportReq 导出服务日志列表 +type ExportReq struct { + g.Meta `path:"/serveLog/export" method:"get" tags:"服务日志" summary:"导出服务日志列表"` + sysin.ServeLogListInp +} + +type ExportRes struct{} + +// ViewReq 获取服务日志指定信息 +type ViewReq struct { + g.Meta `path:"/serveLog/view" method:"get" tags:"服务日志" summary:"获取服务日志指定信息"` + sysin.ServeLogViewInp +} + +type ViewRes struct { + *sysin.ServeLogViewModel +} + +// DeleteReq 删除服务日志 +type DeleteReq struct { + g.Meta `path:"/serveLog/delete" method:"post" tags:"服务日志" summary:"删除服务日志"` + sysin.ServeLogDeleteInp +} + +type DeleteRes struct{} diff --git a/server/api/admin/smslog/smslog.go b/server/api/admin/smslog/smslog.go new file mode 100644 index 0000000..ed97c2d --- /dev/null +++ b/server/api/admin/smslog/smslog.go @@ -0,0 +1,41 @@ +// Package smslog +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package smslog + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +// ListReq 查询列表 +type ListReq struct { + g.Meta `path:"/smsLog/list" method:"get" tags:"短信" summary:"获取短信记录列表"` + sysin.SmsLogListInp +} + +type ListRes struct { + List []*sysin.SmsLogListModel `json:"list" dc:"数据列表"` + form.PageRes +} + +// ViewReq 获取指定信息 +type ViewReq struct { + g.Meta `path:"/smsLog/view" method:"get" tags:"短信" summary:"获取指定短信信息"` + sysin.SmsLogViewInp +} + +type ViewRes struct { + *sysin.SmsLogViewModel +} + +// DeleteReq 删除 +type DeleteReq struct { + g.Meta `path:"/smsLog/delete" method:"post" tags:"短信" summary:"删除短信记录"` + sysin.SmsLogDeleteInp +} + +type DeleteRes struct{} diff --git a/server/api/admin/task/task.go b/server/api/admin/task/task.go new file mode 100644 index 0000000..1e87c88 --- /dev/null +++ b/server/api/admin/task/task.go @@ -0,0 +1,38 @@ +package task + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +type ListReq struct { + g.Meta `path:"/task/list" method:"get" tags:"任务管理" summary:"获取任务列表"` + sysin.TaskListInp +} +type ListRes struct { + form.PageRes + List []*sysin.TaskListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/task/view" method:"get" tags:"任务管理" summary:"获取任务详情"` + sysin.TaskViewInp +} +type ViewRes struct{ *sysin.TaskListModel } +type EditReq struct { + g.Meta `path:"/task/edit" method:"post" tags:"任务管理" summary:"新增编辑任务"` + sysin.TaskEditInp +} +type EditRes struct { + Id uint64 `json:"id"` +} +type StatusReq struct { + g.Meta `path:"/task/status" method:"post" tags:"任务管理" summary:"任务发布下线"` + sysin.TaskStatusInp +} +type StatusRes struct{} +type DeleteReq struct { + g.Meta `path:"/task/delete" method:"post" tags:"任务管理" summary:"删除任务"` + sysin.TaskDeleteInp +} +type DeleteRes struct{} diff --git a/server/api/admin/taskhall/taskhall.go b/server/api/admin/taskhall/taskhall.go new file mode 100644 index 0000000..32b3437 --- /dev/null +++ b/server/api/admin/taskhall/taskhall.go @@ -0,0 +1,36 @@ +package taskhall + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +type ListReq struct { + g.Meta `path:"/taskHall/list" method:"get" tags:"任务大厅" summary:"任务大厅列表"` + sysin.TaskHallListInp +} +type ListRes struct { + form.PageRes + List []*sysin.TaskHallListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/taskHall/view" method:"get" tags:"任务大厅" summary:"任务大厅详情"` + sysin.TaskHallViewInp +} +type ViewRes struct{ *sysin.TaskHallListModel } +type EditReq struct { + g.Meta `path:"/taskHall/edit" method:"post" tags:"任务大厅" summary:"新增编辑任务大厅"` + sysin.TaskHallEditInp +} +type EditRes struct{} +type StatusReq struct { + g.Meta `path:"/taskHall/status" method:"post" tags:"任务大厅" summary:"发布下线任务大厅"` + sysin.TaskHallStatusInp +} +type StatusRes struct{} +type DeleteReq struct { + g.Meta `path:"/taskHall/delete" method:"post" tags:"任务大厅" summary:"删除任务大厅"` + sysin.TaskHallDeleteInp +} +type DeleteRes struct{} diff --git a/server/api/admin/tasksubmission/tasksubmission.go b/server/api/admin/tasksubmission/tasksubmission.go new file mode 100644 index 0000000..fbcfc94 --- /dev/null +++ b/server/api/admin/tasksubmission/tasksubmission.go @@ -0,0 +1,26 @@ +package tasksubmission + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" +) + +type ListReq struct { + g.Meta `path:"/taskSubmission/list" method:"get" tags:"会员任务审核" summary:"获取会员任务提交"` + sysin.TaskSubmissionListInp +} +type ListRes struct { + form.PageRes + List []*sysin.TaskSubmissionListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/taskSubmission/view" method:"get" tags:"会员任务审核" summary:"获取任务提交详情"` + sysin.TaskSubmissionViewInp +} +type ViewRes struct{ *sysin.TaskSubmissionListModel } +type ReviewReq struct { + g.Meta `path:"/taskSubmission/review" method:"post" tags:"会员任务审核" summary:"审核并结算会员任务"` + sysin.TaskSubmissionReviewInp +} +type ReviewRes struct{} diff --git a/server/api/admin/testcategory/testcategory.go b/server/api/admin/testcategory/testcategory.go new file mode 100644 index 0000000..7a8eca3 --- /dev/null +++ b/server/api/admin/testcategory/testcategory.go @@ -0,0 +1,69 @@ +// Package testcategory +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.15.7 +package testcategory + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +// ListReq 查询测试分类列表 +type ListReq struct { + g.Meta `path:"/testCategory/list" method:"get" tags:"测试分类" summary:"获取测试分类列表"` + sysin.TestCategoryListInp +} + +type ListRes struct { + form.PageRes + List []*sysin.TestCategoryListModel `json:"list" dc:"数据列表"` +} + +// ViewReq 获取测试分类指定信息 +type ViewReq struct { + g.Meta `path:"/testCategory/view" method:"get" tags:"测试分类" summary:"获取测试分类指定信息"` + sysin.TestCategoryViewInp +} + +type ViewRes struct { + *sysin.TestCategoryViewModel +} + +// EditReq 修改/新增测试分类 +type EditReq struct { + g.Meta `path:"/testCategory/edit" method:"post" tags:"测试分类" summary:"修改/新增测试分类"` + sysin.TestCategoryEditInp +} + +type EditRes struct{} + +// DeleteReq 删除测试分类 +type DeleteReq struct { + g.Meta `path:"/testCategory/delete" method:"post" tags:"测试分类" summary:"删除测试分类"` + sysin.TestCategoryDeleteInp +} + +type DeleteRes struct{} + +// MaxSortReq 获取测试分类最大排序 +type MaxSortReq struct { + g.Meta `path:"/testCategory/maxSort" method:"get" tags:"测试分类" summary:"获取测试分类最大排序"` + sysin.TestCategoryMaxSortInp +} + +type MaxSortRes struct { + *sysin.TestCategoryMaxSortModel +} + +// StatusReq 更新测试分类状态 +type StatusReq struct { + g.Meta `path:"/testCategory/status" method:"post" tags:"测试分类" summary:"更新测试分类状态"` + sysin.TestCategoryStatusInp +} + +type StatusRes struct{} diff --git a/server/api/admin/tradeorder/tradeorder.go b/server/api/admin/tradeorder/tradeorder.go new file mode 100644 index 0000000..a8fe652 --- /dev/null +++ b/server/api/admin/tradeorder/tradeorder.go @@ -0,0 +1,45 @@ +package tradeorder + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +type ListReq struct { + g.Meta `path:"/tradeOrder/list" method:"get" tags:"交易订单" summary:"交易订单列表"` + sysin.TradeOrderListInp +} +type ListRes struct { + form.PageRes + List []*sysin.TradeOrderListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/tradeOrder/view" method:"get" tags:"交易订单" summary:"交易订单详情"` + sysin.TradeOrderViewInp +} +type ViewRes struct{ *sysin.TradeOrderViewModel } +type MatchProductsReq struct { + g.Meta `path:"/tradeOrder/matchProducts" method:"get" tags:"交易订单" summary:"获取可匹配商品"` + sysin.TradeOrderMatchProductListInp +} +type MatchProductsRes struct { + form.PageRes + List []*sysin.TradeOrderMatchProductModel `json:"list"` +} +type MatchReq struct { + g.Meta `path:"/tradeOrder/match" method:"post" tags:"交易订单" summary:"人工匹配订单商品"` + sysin.TradeOrderMatchInp +} +type MatchRes struct{} +type ApplyReq struct { + g.Meta `path:"/tradeOrder/apply" method:"post" tags:"交易订单" summary:"提交订单人工处理审批"` + sysin.TradeOrderApplyInp +} +type ApplyRes struct{ *sysin.FinanceApprovalModel } +type ExecuteReq struct { + g.Meta `path:"/tradeOrder/execute" method:"post" tags:"交易订单" summary:"执行已审批订单处理"` + sysin.TradeOrderExecuteInp +} +type ExecuteRes struct{} diff --git a/server/api/admin/withdrawalorder/withdrawalorder.go b/server/api/admin/withdrawalorder/withdrawalorder.go new file mode 100644 index 0000000..2302602 --- /dev/null +++ b/server/api/admin/withdrawalorder/withdrawalorder.go @@ -0,0 +1,39 @@ +package withdrawalorder + +import ( + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + + "github.com/gogf/gf/v2/frame/g" +) + +type ListReq struct { + g.Meta `path:"/withdrawalOrder/list" method:"get" tags:"提现管理" summary:"提现订单列表"` + sysin.WithdrawalOrderListInp +} +type ListRes struct { + form.PageRes + List []*sysin.WithdrawalOrderListModel `json:"list"` +} +type ViewReq struct { + g.Meta `path:"/withdrawalOrder/view" method:"get" tags:"提现管理" summary:"提现订单详情(仅脱敏账户)"` + sysin.WithdrawalOrderViewInp +} +type ViewRes struct { + *sysin.WithdrawalOrderListModel +} +type ReviewReq struct { + g.Meta `path:"/withdrawalOrder/review" method:"post" tags:"提现管理" summary:"提交提现审核"` + sysin.WithdrawalReviewInp +} +type ReviewRes struct{ *sysin.FinanceApprovalModel } +type ExecuteReq struct { + g.Meta `path:"/withdrawalOrder/execute" method:"post" tags:"提现管理" summary:"执行已审批提现审核"` + sysin.FinanceExecuteInp +} +type ExecuteRes struct{} +type CompleteReq struct { + g.Meta `path:"/withdrawalOrder/complete" method:"post" tags:"提现管理" summary:"登记提现付款结果"` + sysin.WithdrawalCompleteInp +} +type CompleteRes struct{} diff --git a/server/api/api/member/member.go b/server/api/api/member/member.go new file mode 100644 index 0000000..d335001 --- /dev/null +++ b/server/api/api/member/member.go @@ -0,0 +1,15 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package member + +import ( + "context" + + "hotgo/api/api/member/v1" +) + +type IMemberV1 interface { + GetIdByCode(ctx context.Context, req *v1.GetIdByCodeReq) (res *v1.GetIdByCodeRes, err error) +} diff --git a/server/api/api/member/v1/member.go b/server/api/api/member/v1/member.go new file mode 100644 index 0000000..0ed4bb6 --- /dev/null +++ b/server/api/api/member/v1/member.go @@ -0,0 +1,16 @@ +// Package member +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package v1 + +import "github.com/gogf/gf/v2/frame/g" + +// GetIdByCodeReq 通过邀请码获取用户ID +type GetIdByCodeReq struct { + g.Meta `path:"/member/getIdByCode" method:"post" tags:"用户" summary:"通过邀请码获取用户ID"` + Code string `json:"code" dc:"邀请码"` +} + +type GetIdByCodeRes struct{} diff --git a/server/api/api/pay/pay.go b/server/api/api/pay/pay.go new file mode 100644 index 0000000..654099c --- /dev/null +++ b/server/api/api/pay/pay.go @@ -0,0 +1,17 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package pay + +import ( + "context" + + "hotgo/api/api/pay/v1" +) + +type IPayV1 interface { + NotifyAliPay(ctx context.Context, req *v1.NotifyAliPayReq) (res *v1.NotifyAliPayRes, err error) + NotifyWxPay(ctx context.Context, req *v1.NotifyWxPayReq) (res *v1.NotifyWxPayRes, err error) + NotifyQQPay(ctx context.Context, req *v1.NotifyQQPayReq) (res *v1.NotifyQQPayRes, err error) +} diff --git a/server/api/api/pay/v1/notify.go b/server/api/api/pay/v1/notify.go new file mode 100644 index 0000000..8ac343b --- /dev/null +++ b/server/api/api/pay/v1/notify.go @@ -0,0 +1,41 @@ +// Package pay +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package v1 + +import ( + "hotgo/internal/model/input/payin" + + "github.com/gogf/gf/v2/frame/g" +) + +// NotifyAliPayReq 支付宝回调 +type NotifyAliPayReq struct { + g.Meta `path:"/pay/notify/alipay" method:"post" tags:"支付异步通知" summary:"支付宝回调"` +} + +type NotifyAliPayRes struct { + g.Meta `mime:"text/html" type:"string" example:" + 这是您通过HotGo后台发送的测试邮件。当你收到这封邮件的时候,说明已经联调成功了,恭喜你! + + `, + }) + return +} + +// SendBindEms 发送换绑邮件 +func (c *cEms) SendBindEms(ctx context.Context, _ *common.SendBindEmsReq) (res *common.SendBindEmsRes, err error) { + var ( + memberId = contexts.GetUserId(ctx) + models *entity.AdminMember + ) + + if memberId <= 0 { + err = gerror.New("用户身份异常,请重新登录!") + return + } + + if err = dao.AdminMember.Ctx(ctx).Fields(dao.AdminMember.Columns().Email).Where(dao.AdminMember.Columns().Id, memberId).Scan(&models); err != nil { + return + } + + if models == nil { + err = gerror.New("用户信息不存在") + return + } + + if models.Email == "" { + err = gerror.New("未绑定邮箱无需发送") + return + } + + err = service.SysEmsLog().Send(ctx, &sysin.SendEmsInp{ + Event: consts.EmsTemplateBind, + Email: models.Email, + }) + return +} diff --git a/server/internal/controller/admin/common/site.go b/server/internal/controller/admin/common/site.go new file mode 100644 index 0000000..34296a6 --- /dev/null +++ b/server/internal/controller/admin/common/site.go @@ -0,0 +1,155 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "context" + "hotgo/api/admin/common" + "hotgo/internal/consts" + "hotgo/internal/library/captcha" + "hotgo/internal/library/token" + "hotgo/internal/service" + "hotgo/utility/validate" + + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/text/gstr" + "github.com/gogf/gf/v2/util/gconv" + "github.com/gogf/gf/v2/util/gmode" +) + +var Site = cSite{} + +type cSite struct{} + +// Ping ping +func (c *cSite) Ping(_ context.Context, _ *common.SitePingReq) (res *common.SitePingRes, err error) { + return +} + +// Config 获取配置 +func (c *cSite) Config(ctx context.Context, _ *common.SiteConfigReq) (res *common.SiteConfigRes, err error) { + request := ghttp.RequestFromCtx(ctx) + res = &common.SiteConfigRes{ + Version: consts.VersionApp, + WsAddr: c.getWsAddr(ctx, request), + Domain: c.getDomain(ctx, request), + Mode: gmode.Mode(), + } + return +} + +func (c *cSite) getWsAddr(ctx context.Context, request *ghttp.Request) string { + // 如果是本地IP访问,则认为是调试模式,走实际请求地址,否则走配置中的地址 + // 尝试读取hostname,兼容本地运行模式 + ip := ghttp.RequestFromCtx(ctx).GetHeader("hostname") + if len(ip) == 0 { + ip = ghttp.RequestFromCtx(ctx).GetHost() + } + + if validate.IsLocalIPAddr(ip) { + return "ws://" + ip + ":" + gstr.StrEx(request.Host, ":") + g.Cfg().MustGet(ctx, "router.websocket.prefix").String() + } + + basic, err := service.SysConfig().GetBasic(ctx) + if err != nil || basic == nil { + return "" + } + return basic.WsAddr +} + +func (c *cSite) getDomain(ctx context.Context, request *ghttp.Request) string { + // 如果是本地IP访问,则认为是调试模式,走实际请求地址,否则走配置中的地址 + // 尝试读取hostname,兼容本地运行模式 + ip := ghttp.RequestFromCtx(ctx).GetHeader("hostname") + if len(ip) == 0 { + ip = ghttp.RequestFromCtx(ctx).GetHost() + } + + if validate.IsLocalIPAddr(ip) { + return "http://" + ip + ":" + gstr.StrEx(request.Host, ":") + } + + basic, err := service.SysConfig().GetBasic(ctx) + if err != nil || basic == nil { + return "" + } + return basic.Domain +} + +// LoginConfig 登录配置 +func (c *cSite) LoginConfig(ctx context.Context, _ *common.SiteLoginConfigReq) (res *common.SiteLoginConfigRes, err error) { + res = new(common.SiteLoginConfigRes) + login, err := service.SysConfig().GetLogin(ctx) + if err != nil { + return + } + + res.LoginConfig = login + res.I18nSwitch = g.Cfg().MustGet(ctx, "system.i18n.switch", true).Bool() + res.DefaultLanguage = g.Cfg().MustGet(ctx, "system.i18n.defaultLanguage", consts.SysDefaultLanguage).String() + res.ProjectName = "企业办公管理系统" + return +} + +// Captcha 登录验证码 +func (c *cSite) Captcha(ctx context.Context, _ *common.LoginCaptchaReq) (res *common.LoginCaptchaRes, err error) { + loginConf, err := service.SysConfig().GetLogin(ctx) + if err != nil { + return + } + cid, base64 := captcha.Generate(ctx, loginConf.CaptchaType) + res = &common.LoginCaptchaRes{Cid: cid, Base64: base64} + return +} + +// Register 账号注册 +func (c *cSite) Register(ctx context.Context, req *common.RegisterReq) (res *common.RegisterRes, err error) { + err = service.AdminSite().Register(ctx, &req.RegisterInp) + return +} + +// AccountLogin 账号登录 +func (c *cSite) AccountLogin(ctx context.Context, req *common.AccountLoginReq) (res *common.AccountLoginRes, err error) { + login, err := service.SysConfig().GetLogin(ctx) + if err != nil { + return + } + + if !req.IsLock && login.CaptchaSwitch == consts.StatusEnabled { + // 校验 验证码 + if !captcha.Verify(req.Cid, req.Code) { + err = gerror.New("验证码错误") + return + } + } + + model, err := service.AdminSite().AccountLogin(ctx, &req.AccountLoginInp) + if err != nil { + return + } + + err = gconv.Scan(model, &res) + return +} + +// MobileLogin 手机号登录 +func (c *cSite) MobileLogin(ctx context.Context, req *common.MobileLoginReq) (res *common.MobileLoginRes, err error) { + model, err := service.AdminSite().MobileLogin(ctx, &req.MobileLoginInp) + if err != nil { + return + } + + err = gconv.Scan(model, &res) + return +} + +// Logout 注销登录 +func (c *cSite) Logout(ctx context.Context, _ *common.LoginLogoutReq) (res *common.LoginLogoutRes, err error) { + err = token.Logout(ghttp.RequestFromCtx(ctx)) + return +} diff --git a/server/internal/controller/admin/common/sms.go b/server/internal/controller/admin/common/sms.go new file mode 100644 index 0000000..c1f5c6a --- /dev/null +++ b/server/internal/controller/admin/common/sms.go @@ -0,0 +1,67 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "hotgo/api/admin/common" + "hotgo/internal/consts" + "hotgo/internal/dao" + "hotgo/internal/library/contexts" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var Sms = new(cSms) + +type cSms struct{} + +// SendTest 发送测试短信 +func (c *cSms) SendTest(ctx context.Context, req *common.SendTestSmsReq) (res *common.SendTestSmsRes, err error) { + err = service.SysSmsLog().SendCode(ctx, &req.SendCodeInp) + return +} + +// SendBindSms 发送换绑短信 +func (c *cSms) SendBindSms(ctx context.Context, _ *common.SendBindSmsReq) (res *common.SendBindSmsRes, err error) { + var ( + memberId = contexts.GetUserId(ctx) + models *entity.AdminMember + ) + + if memberId <= 0 { + err = gerror.New("用户身份异常,请重新登录!") + return + } + + if err = dao.AdminMember.Ctx(ctx).Fields(dao.AdminMember.Columns().Mobile).Where(dao.AdminMember.Columns().Id, memberId).Scan(&models); err != nil { + return + } + + if models == nil { + err = gerror.New("用户信息不存在") + return + } + + if models.Mobile == "" { + err = gerror.New("未绑定手机号无需发送") + return + } + + err = service.SysSmsLog().SendCode(ctx, &sysin.SendCodeInp{ + Event: consts.SmsTemplateBind, + Mobile: models.Mobile, + }) + return +} + +// SendSms 发送短信 +func (c *cSms) SendSms(ctx context.Context, req *common.SendSmsReq) (res *common.SendSmsRes, err error) { + err = service.SysSmsLog().SendCode(ctx, &req.SendCodeInp) + return +} diff --git a/server/internal/controller/admin/common/upload.go b/server/internal/controller/admin/common/upload.go new file mode 100644 index 0000000..82f00aa --- /dev/null +++ b/server/internal/controller/admin/common/upload.go @@ -0,0 +1,66 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "hotgo/api/admin/common" + "hotgo/internal/library/storager" + "hotgo/internal/service" + "hotgo/utility/validate" +) + +var Upload = new(cUpload) + +type cUpload struct{} + +// UploadFile 上传文件 +func (c *cUpload) UploadFile(ctx context.Context, _ *common.UploadFileReq) (res common.UploadFileRes, err error) { + r := g.RequestFromCtx(ctx) + uploadType := r.Header.Get("uploadType") + if uploadType != "default" && !validate.InSlice(storager.KindSlice, uploadType) { + err = gerror.New("上传类型是无效的") + return + } + + file := r.GetUploadFile("file") + if file == nil { + err = gerror.New("没有找到上传的文件") + return + } + return service.CommonUpload().UploadFile(ctx, uploadType, file) +} + +// CheckMultipart 检查文件分片 +func (c *cUpload) CheckMultipart(ctx context.Context, req *common.CheckMultipartReq) (res *common.CheckMultipartRes, err error) { + data, err := service.CommonUpload().CheckMultipart(ctx, &req.CheckMultipartInp) + if err != nil { + return nil, err + } + res = new(common.CheckMultipartRes) + res.CheckMultipartModel = data + return +} + +// UploadPart 上传分片 +func (c *cUpload) UploadPart(ctx context.Context, req *common.UploadPartReq) (res *common.UploadPartRes, err error) { + data, err := service.CommonUpload().UploadPart(ctx, &req.UploadPartInp) + if err != nil { + return nil, err + } + res = new(common.UploadPartRes) + res.UploadPartModel = data + return +} + +// ImageTransferStorage 图片链接转存 +func (c *cUpload) ImageTransferStorage(ctx context.Context, req *common.ImageTransferStorageReq) (res *common.ImageTransferStorageRes, err error) { + res = new(common.ImageTransferStorageRes) + res.ImageTransferStorageModel, err = service.CommonUpload().ImageTransferStorage(ctx, &req.ImageTransferStorageInp) + return +} diff --git a/server/internal/controller/admin/common/wechat.go b/server/internal/controller/admin/common/wechat.go new file mode 100644 index 0000000..4e658d3 --- /dev/null +++ b/server/internal/controller/admin/common/wechat.go @@ -0,0 +1,28 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "context" + "hotgo/api/admin/common" + "hotgo/internal/service" +) + +var ( + Wechat = cWechat{} +) + +type cWechat struct{} + +func (c *cWechat) Authorize(ctx context.Context, req *common.WechatAuthorizeReq) (res *common.WechatAuthorizeRes, err error) { + _, err = service.CommonWechat().Authorize(ctx, &req.WechatAuthorizeInp) + return +} + +func (c *cWechat) AuthorizeCall(ctx context.Context, req *common.WechatAuthorizeCallReq) (res *common.WechatAuthorizeCallRes, err error) { + _, err = service.CommonWechat().AuthorizeCall(ctx, &req.WechatAuthorizeCallInp) + return +} diff --git a/server/internal/controller/admin/pay/refund.go b/server/internal/controller/admin/pay/refund.go new file mode 100644 index 0000000..1facbfe --- /dev/null +++ b/server/internal/controller/admin/pay/refund.go @@ -0,0 +1,39 @@ +// Package pay +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.5.3 +// @AutoGenerate Date 2023-04-15 15:59:58 +package pay + +import ( + "context" + "hotgo/api/admin/pay" + "hotgo/internal/service" +) + +var ( + Refund = cRefund{} +) + +type cRefund struct{} + +// List 查看交易退款列表 +func (c *cRefund) List(ctx context.Context, req *pay.RefundListReq) (res *pay.RefundListRes, err error) { + list, totalCount, err := service.PayRefund().List(ctx, &req.PayRefundListInp) + if err != nil { + return + } + + res = new(pay.RefundListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出交易退款列表 +func (c *cRefund) Export(ctx context.Context, req *pay.RefundExportReq) (res *pay.RefundExportRes, err error) { + err = service.PayRefund().Export(ctx, &req.PayRefundListInp) + return +} diff --git a/server/internal/controller/admin/sys/addons.go b/server/internal/controller/admin/sys/addons.go new file mode 100644 index 0000000..73ba447 --- /dev/null +++ b/server/internal/controller/admin/sys/addons.go @@ -0,0 +1,61 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/addons" + "hotgo/internal/service" +) + +var ( + Addons = cAddons{} +) + +type cAddons struct{} + +// List 查看列表 +func (c *cAddons) List(ctx context.Context, req *addons.ListReq) (res *addons.ListRes, err error) { + list, totalCount, err := service.SysAddons().List(ctx, &req.AddonsListInp) + if err != nil { + return + } + + res = new(addons.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Build 生成预览 +func (c *cAddons) Build(ctx context.Context, req *addons.BuildReq) (res *addons.BuildRes, err error) { + err = service.SysAddons().Build(ctx, &req.AddonsBuildInp) + return +} + +// Install 安装模块 +func (c *cAddons) Install(ctx context.Context, req *addons.InstallReq) (res *addons.InstallRes, err error) { + if err = service.SysAddons().Install(ctx, &req.AddonsInstallInp); err != nil { + return + } + return +} + +// Upgrade 更新模块 +func (c *cAddons) Upgrade(ctx context.Context, req *addons.UpgradeReq) (res *addons.UpgradeRes, err error) { + if err = service.SysAddons().Upgrade(ctx, &req.AddonsUpgradeInp); err != nil { + return + } + return +} + +// UnInstall 卸载模块 +func (c *cAddons) UnInstall(ctx context.Context, req *addons.UnInstallReq) (res *addons.UnInstallRes, err error) { + if err = service.SysAddons().UnInstall(ctx, &req.AddonsUnInstallInp); err != nil { + return + } + return +} diff --git a/server/internal/controller/admin/sys/app_member.go b/server/internal/controller/admin/sys/app_member.go new file mode 100644 index 0000000..d5e7d7c --- /dev/null +++ b/server/internal/controller/admin/sys/app_member.go @@ -0,0 +1,157 @@ +package sys + +import ( + "context" + "hotgo/api/admin/appmember" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var AppMember = cAppMember{} + +type cAppMember struct{} + +func (c *cAppMember) List(ctx context.Context, req *appmember.ListReq) (res *appmember.ListRes, err error) { + list, total, err := service.SysAppMember().List(ctx, &req.AppMemberListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.AppMemberListModel{} + } + res = new(appmember.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cAppMember) View(ctx context.Context, req *appmember.ViewReq) (res *appmember.ViewRes, err error) { + data, err := service.SysAppMember().View(ctx, &req.AppMemberViewInp) + if err != nil { + return + } + res = &appmember.ViewRes{AppMemberViewModel: data} + return +} +func (c *cAppMember) Edit(ctx context.Context, req *appmember.EditReq) (*appmember.EditRes, error) { + return &appmember.EditRes{}, service.SysAppMember().Edit(ctx, &req.AppMemberEditInp) +} +func (c *cAppMember) Delete(ctx context.Context, req *appmember.DeleteReq) (*appmember.DeleteRes, error) { + return &appmember.DeleteRes{}, service.SysAppMember().Delete(ctx, &req.AppMemberDeleteInp) +} +func (c *cAppMember) AutoDispatch(ctx context.Context, req *appmember.AutoDispatchReq) (*appmember.AutoDispatchRes, error) { + return &appmember.AutoDispatchRes{}, service.SysAppMember().AutoDispatch(ctx, &req.AppMemberAutoDispatchInp) +} +func (c *cAppMember) Category(ctx context.Context, req *appmember.CategoryReq) (*appmember.CategoryRes, error) { + return &appmember.CategoryRes{}, service.SysAppMember().Category(ctx, &req.AppMemberCategoryInp) +} +func (c *cAppMember) PaymentList(ctx context.Context, req *appmember.PaymentListReq) (*appmember.PaymentListRes, error) { + list, err := service.SysAppMember().PaymentList(ctx, &req.AppMemberPaymentListInp) + if list == nil { + list = []*sysin.AppMemberPaymentModel{} + } + return &appmember.PaymentListRes{List: list}, err +} +func (c *cAppMember) PaymentEdit(ctx context.Context, req *appmember.PaymentEditReq) (*appmember.PaymentEditRes, error) { + return &appmember.PaymentEditRes{}, service.SysAppMember().PaymentEdit(ctx, &req.AppMemberPaymentEditInp) +} +func (c *cAppMember) PaymentDelete(ctx context.Context, req *appmember.PaymentDeleteReq) (*appmember.PaymentDeleteRes, error) { + return &appmember.PaymentDeleteRes{}, service.SysAppMember().PaymentDelete(ctx, &req.AppMemberPaymentDeleteInp) +} +func (c *cAppMember) AddressList(ctx context.Context, req *appmember.AddressListReq) (*appmember.AddressListRes, error) { + list, err := service.SysAppMember().AddressList(ctx, &req.AppMemberAddressListInp) + if list == nil { + list = []*sysin.AppMemberAddressModel{} + } + return &appmember.AddressListRes{List: list}, err +} +func (c *cAppMember) AddressEdit(ctx context.Context, req *appmember.AddressEditReq) (*appmember.AddressEditRes, error) { + return &appmember.AddressEditRes{}, service.SysAppMember().AddressEdit(ctx, &req.AppMemberAddressEditInp) +} +func (c *cAppMember) AddressDelete(ctx context.Context, req *appmember.AddressDeleteReq) (*appmember.AddressDeleteRes, error) { + return &appmember.AddressDeleteRes{}, service.SysAppMember().AddressDelete(ctx, &req.AppMemberAddressDeleteInp) +} +func (c *cAppMember) Sensitive(ctx context.Context, req *appmember.SensitiveReq) (res *appmember.SensitiveRes, err error) { + data, err := service.SysAppMember().Sensitive(ctx, &req.AppMemberSensitiveInp) + if err != nil { + return + } + return &appmember.SensitiveRes{AppMemberSensitiveModel: data}, nil +} +func (c *cAppMember) Team(ctx context.Context, req *appmember.TeamReq) (res *appmember.TeamRes, err error) { + list, total, err := service.SysAppMember().Team(ctx, &req.AppMemberTeamInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.AppMemberTeamModel{} + } + res = new(appmember.TeamRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cAppMember) StatusRequest(ctx context.Context, req *appmember.StatusRequestReq) (res *appmember.StatusRequestRes, err error) { + data, err := service.SysAppMember().StatusRequest(ctx, &req.AppMemberStatusRequestInp) + if err != nil { + return + } + return &appmember.StatusRequestRes{AppMemberApprovalModel: data}, nil +} +func (c *cAppMember) StatusExecute(ctx context.Context, req *appmember.StatusExecuteReq) (*appmember.StatusExecuteRes, error) { + return &appmember.StatusExecuteRes{}, service.SysAppMember().StatusExecute(ctx, &req.AppMemberStatusExecuteInp) +} +func (c *cAppMember) WalletList(ctx context.Context, req *appmember.WalletListReq) (res *appmember.WalletListRes, err error) { + list, total, err := service.SysAppMember().WalletList(ctx, &req.WalletAdjustmentListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.WalletAdjustmentListModel{} + } + res = new(appmember.WalletListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cAppMember) LedgerList(ctx context.Context, req *appmember.LedgerListReq) (res *appmember.LedgerListRes, err error) { + list, total, err := service.SysAppMember().LedgerList(ctx, &req.WalletLedgerListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.WalletLedgerListModel{} + } + res = new(appmember.LedgerListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cAppMember) WalletRequest(ctx context.Context, req *appmember.WalletRequestReq) (res *appmember.WalletRequestRes, err error) { + data, err := service.SysAppMember().WalletRequest(ctx, &req.WalletAdjustmentRequestInp) + if err != nil { + return + } + return &appmember.WalletRequestRes{AppMemberApprovalModel: data}, nil +} +func (c *cAppMember) WalletExecute(ctx context.Context, req *appmember.WalletExecuteReq) (*appmember.WalletExecuteRes, error) { + return &appmember.WalletExecuteRes{}, service.SysAppMember().WalletExecute(ctx, &req.WalletAdjustmentExecuteInp) +} +func (c *cAppMember) NoticeList(ctx context.Context, req *appmember.NoticeListReq) (res *appmember.NoticeListRes, err error) { + list, total, err := service.SysAppMember().NoticeList(ctx, &req.MemberNoticeListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.MemberNoticeListModel{} + } + res = new(appmember.NoticeListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cAppMember) NoticeEdit(ctx context.Context, req *appmember.NoticeEditReq) (*appmember.NoticeEditRes, error) { + return &appmember.NoticeEditRes{}, service.SysAppMember().NoticeEdit(ctx, &req.MemberNoticeEditInp) +} +func (c *cAppMember) NoticeRevoke(ctx context.Context, req *appmember.NoticeRevokeReq) (*appmember.NoticeRevokeRes, error) { + return &appmember.NoticeRevokeRes{}, service.SysAppMember().NoticeRevoke(ctx, &req.MemberNoticeRevokeInp) +} diff --git a/server/internal/controller/admin/sys/approval.go b/server/internal/controller/admin/sys/approval.go new file mode 100644 index 0000000..4d67ba9 --- /dev/null +++ b/server/internal/controller/admin/sys/approval.go @@ -0,0 +1,64 @@ +package sys + +import ( + "context" + "hotgo/api/admin/approval" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var Approval = cApproval{} + +type cApproval struct{} + +func (c *cApproval) List(ctx context.Context, req *approval.ListReq) (res *approval.ListRes, err error) { + list, totalCount, err := service.SysApproval().List(ctx, &req.ApprovalListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.ApprovalListModel{} + } + res = new(approval.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +func (c *cApproval) View(ctx context.Context, req *approval.ViewReq) (res *approval.ViewRes, err error) { + data, err := service.SysApproval().View(ctx, &req.ApprovalViewInp) + if err != nil { + return nil, err + } + res = &approval.ViewRes{ApprovalViewModel: data} + return +} + +func (c *cApproval) Create(ctx context.Context, req *approval.CreateReq) (res *approval.CreateRes, err error) { + data, err := service.SysApproval().Create(ctx, &req.ApprovalCreateInp) + if err != nil { + return nil, err + } + res = &approval.CreateRes{ApprovalCreateModel: data} + return +} + +func (c *cApproval) Submit(ctx context.Context, req *approval.SubmitReq) (res *approval.SubmitRes, err error) { + err = service.SysApproval().Submit(ctx, &req.ApprovalSubmitInp) + return +} + +func (c *cApproval) Approve(ctx context.Context, req *approval.ApproveReq) (res *approval.ApproveRes, err error) { + err = service.SysApproval().Approve(ctx, &req.ApprovalDecisionInp) + return +} + +func (c *cApproval) Reject(ctx context.Context, req *approval.RejectReq) (res *approval.RejectRes, err error) { + err = service.SysApproval().Reject(ctx, &req.ApprovalDecisionInp) + return +} + +func (c *cApproval) Cancel(ctx context.Context, req *approval.CancelReq) (res *approval.CancelRes, err error) { + err = service.SysApproval().Cancel(ctx, &req.ApprovalCancelInp) + return +} diff --git a/server/internal/controller/admin/sys/attachment.go b/server/internal/controller/admin/sys/attachment.go new file mode 100644 index 0000000..9380887 --- /dev/null +++ b/server/internal/controller/admin/sys/attachment.go @@ -0,0 +1,55 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/attachment" + "hotgo/internal/service" +) + +var ( + Attachment = cAttachment{} +) + +type cAttachment struct{} + +// Delete 删除附件 +func (c *cAttachment) Delete(ctx context.Context, req *attachment.DeleteReq) (res *attachment.DeleteRes, err error) { + err = service.SysAttachment().Delete(ctx, &req.AttachmentDeleteInp) + return +} + +// View 获取指定附件信息 +func (c *cAttachment) View(ctx context.Context, req *attachment.ViewReq) (res *attachment.ViewRes, err error) { + data, err := service.SysAttachment().View(ctx, &req.AttachmentViewInp) + if err != nil { + return + } + + res = new(attachment.ViewRes) + res.AttachmentViewModel = data + return +} + +// List 查看附件列表 +func (c *cAttachment) List(ctx context.Context, req *attachment.ListReq) (res *attachment.ListRes, err error) { + list, totalCount, err := service.SysAttachment().List(ctx, &req.AttachmentListInp) + if err != nil { + return + } + + res = new(attachment.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// ClearKind 清空上传类型 +func (c *cAttachment) ClearKind(ctx context.Context, req *attachment.ClearKindReq) (res *attachment.ClearKindRes, err error) { + err = service.SysAttachment().ClearKind(ctx, &req.AttachmentClearKindInp) + return +} diff --git a/server/internal/controller/admin/sys/biz_audit.go b/server/internal/controller/admin/sys/biz_audit.go new file mode 100644 index 0000000..94c29c1 --- /dev/null +++ b/server/internal/controller/admin/sys/biz_audit.go @@ -0,0 +1,34 @@ +package sys + +import ( + "context" + "hotgo/api/admin/bizaudit" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var BizAudit = cBizAudit{} + +type cBizAudit struct{} + +func (c *cBizAudit) List(ctx context.Context, req *bizaudit.ListReq) (res *bizaudit.ListRes, err error) { + list, totalCount, err := service.SysBizAudit().List(ctx, &req.BizAuditListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.BizAuditListModel{} + } + res = new(bizaudit.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +func (c *cBizAudit) View(ctx context.Context, req *bizaudit.ViewReq) (res *bizaudit.ViewRes, err error) { + data, err := service.SysBizAudit().View(ctx, &req.BizAuditViewInp) + if err != nil { + return nil, err + } + return &bizaudit.ViewRes{BizAuditViewModel: data}, nil +} diff --git a/server/internal/controller/admin/sys/blacklist.go b/server/internal/controller/admin/sys/blacklist.go new file mode 100644 index 0000000..cac7c3d --- /dev/null +++ b/server/internal/controller/admin/sys/blacklist.go @@ -0,0 +1,61 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/blacklist" + "hotgo/internal/service" +) + +var ( + Blacklist = cBlacklist{} +) + +type cBlacklist struct{} + +// Delete 删除 +func (c *cBlacklist) Delete(ctx context.Context, req *blacklist.DeleteReq) (res *blacklist.DeleteRes, err error) { + err = service.SysBlacklist().Delete(ctx, &req.BlacklistDeleteInp) + return +} + +// Edit 更新 +func (c *cBlacklist) Edit(ctx context.Context, req *blacklist.EditReq) (res *blacklist.EditRes, err error) { + err = service.SysBlacklist().Edit(ctx, &req.BlacklistEditInp) + return +} + +// View 获取指定信息 +func (c *cBlacklist) View(ctx context.Context, req *blacklist.ViewReq) (res *blacklist.ViewRes, err error) { + data, err := service.SysBlacklist().View(ctx, &req.BlacklistViewInp) + if err != nil { + return + } + + res = new(blacklist.ViewRes) + res.BlacklistViewModel = data + return +} + +// List 查看列表 +func (c *cBlacklist) List(ctx context.Context, req *blacklist.ListReq) (res *blacklist.ListRes, err error) { + list, totalCount, err := service.SysBlacklist().List(ctx, &req.BlacklistListInp) + if err != nil { + return + } + + res = new(blacklist.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新黑名单状态 +func (c *cBlacklist) Status(ctx context.Context, req *blacklist.StatusReq) (res *blacklist.StatusRes, err error) { + err = service.SysBlacklist().Status(ctx, &req.BlacklistStatusInp) + return +} diff --git a/server/internal/controller/admin/sys/config.go b/server/internal/controller/admin/sys/config.go new file mode 100644 index 0000000..a831c80 --- /dev/null +++ b/server/internal/controller/admin/sys/config.go @@ -0,0 +1,53 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/config" + "hotgo/internal/consts" + "hotgo/internal/model/input/form" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + Config = cConfig{} +) + +type cConfig struct{} + +// GetConfig 获取指定分组的配置 +func (c *cConfig) GetConfig(ctx context.Context, req *config.GetReq) (res *config.GetRes, err error) { + res = new(config.GetRes) + res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, &req.GetConfigInp) + return +} + +// UpdateConfig 更新指定分组的配置 +func (c *cConfig) UpdateConfig(ctx context.Context, req *config.UpdateReq) (res *config.UpdateRes, err error) { + err = service.SysConfig().UpdateConfigByGroup(ctx, &req.UpdateConfigInp) + return +} + +// TypeSelect 数据类型选项 +func (c *cConfig) TypeSelect(_ context.Context, _ *config.TypeSelectReq) (res config.TypeSelectRes, err error) { + for _, v := range consts.ConfigTypes { + res = append(res, form.Select{ + Value: v, + Name: v, + Label: v, + }) + } + return +} + +// GetCash 获取提现的配置 +func (c *cConfig) GetCash(ctx context.Context, _ *config.GetCashReq) (res *config.GetCashRes, err error) { + res = new(config.GetCashRes) + res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, &sysin.GetConfigInp{Group: "cash"}) + return +} diff --git a/server/internal/controller/admin/sys/cron.go b/server/internal/controller/admin/sys/cron.go new file mode 100644 index 0000000..e87e98b --- /dev/null +++ b/server/internal/controller/admin/sys/cron.go @@ -0,0 +1,97 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "hotgo/api/admin/cron" + "hotgo/api/servmsg" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + Cron = cCron{} +) + +type cCron struct{} + +// Delete 删除 +func (c *cCron) Delete(ctx context.Context, req *cron.DeleteReq) (res *cron.DeleteRes, err error) { + err = service.TCPServer().CronDelete(ctx, &servmsg.CronDeleteReq{CronDeleteInp: &req.CronDeleteInp}) + return +} + +// Edit 更新 +func (c *cCron) Edit(ctx context.Context, req *cron.EditReq) (res *cron.EditRes, err error) { + err = service.TCPServer().CronEdit(ctx, &servmsg.CronEditReq{CronEditInp: &req.CronEditInp}) + return +} + +// MaxSort 最大排序 +func (c *cCron) MaxSort(ctx context.Context, req *cron.MaxSortReq) (res *cron.MaxSortRes, err error) { + res = new(cron.MaxSortRes) + res.CronMaxSortModel, err = service.SysCron().MaxSort(ctx, &req.CronMaxSortInp) + return +} + +// View 获取指定信息 +func (c *cCron) View(ctx context.Context, req *cron.ViewReq) (res *cron.ViewRes, err error) { + data, err := service.SysCron().View(ctx, &req.CronViewInp) + if err != nil { + return + } + + res = new(cron.ViewRes) + res.CronViewModel = data + return +} + +// List 查看列表 +func (c *cCron) List(ctx context.Context, req *cron.ListReq) (res *cron.ListRes, err error) { + list, totalCount, err := service.SysCron().List(ctx, &req.CronListInp) + if err != nil { + return + } + + res = new(cron.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新状态 +func (c *cCron) Status(ctx context.Context, req *cron.StatusReq) (res *cron.StatusRes, err error) { + if req.Id <= 0 { + return nil, gerror.New("定时任务ID不能为空") + } + + err = service.TCPServer().CronStatus(ctx, &servmsg.CronStatusReq{CronStatusInp: &req.CronStatusInp}) + return +} + +// OnlineExec 在线执行 +func (c *cCron) OnlineExec(ctx context.Context, req *cron.OnlineExecReq) (res *cron.OnlineExecRes, err error) { + if req.Id <= 0 { + return nil, gerror.New("定时任务ID不能为空") + } + + err = service.TCPServer().CronOnlineExec(ctx, &servmsg.CronOnlineExecReq{OnlineExecInp: &req.OnlineExecInp}) + return +} + +// DispatchLog 调度日志 +func (c *cCron) DispatchLog(ctx context.Context, req *cron.DispatchLogReq) (res *cron.DispatchLogRes, err error) { + if req.Id <= 0 { + return nil, gerror.New("定时任务ID不能为空") + } + + res = new(cron.DispatchLogRes) + res.DispatchLogModel = new(sysin.DispatchLogModel) + res.Log, err = service.TCPServer().DispatchLog(ctx, &servmsg.CronDispatchLogReq{DispatchLogInp: &req.DispatchLogInp}) + return +} diff --git a/server/internal/controller/admin/sys/cron_group.go b/server/internal/controller/admin/sys/cron_group.go new file mode 100644 index 0000000..8362c95 --- /dev/null +++ b/server/internal/controller/admin/sys/cron_group.go @@ -0,0 +1,80 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/cron" + "hotgo/internal/service" +) + +var ( + CronGroup = cCronGroup{} +) + +type cCronGroup struct{} + +// Delete 删除 +func (c *cCronGroup) Delete(ctx context.Context, req *cron.GroupDeleteReq) (res *cron.GroupDeleteRes, err error) { + err = service.SysCronGroup().Delete(ctx, &req.CronGroupDeleteInp) + return +} + +// Edit 更新 +func (c *cCronGroup) Edit(ctx context.Context, req *cron.GroupEditReq) (res *cron.GroupEditRes, err error) { + err = service.SysCronGroup().Edit(ctx, &req.CronGroupEditInp) + return +} + +// MaxSort 最大排序 +func (c *cCronGroup) MaxSort(ctx context.Context, req *cron.GroupMaxSortReq) (res *cron.GroupMaxSortRes, err error) { + res = new(cron.GroupMaxSortRes) + res.CronGroupMaxSortModel, err = service.SysCronGroup().MaxSort(ctx, &req.CronGroupMaxSortInp) + return +} + +// View 获取指定信息 +func (c *cCronGroup) View(ctx context.Context, req *cron.GroupViewReq) (res *cron.GroupViewRes, err error) { + data, err := service.SysCronGroup().View(ctx, &req.CronGroupViewInp) + if err != nil { + return + } + + res = new(cron.GroupViewRes) + res.CronGroupViewModel = data + return +} + +// List 查看列表 +func (c *cCronGroup) List(ctx context.Context, req *cron.GroupListReq) (res *cron.GroupListRes, err error) { + list, totalCount, err := service.SysCronGroup().List(ctx, &req.CronGroupListInp) + if err != nil { + return + } + + res = new(cron.GroupListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新状态 +func (c *cCronGroup) Status(ctx context.Context, req *cron.GroupStatusReq) (res *cron.GroupStatusRes, err error) { + err = service.SysCronGroup().Status(ctx, &req.CronGroupStatusInp) + return +} + +// Select 选项 +func (c *cCronGroup) Select(ctx context.Context, req *cron.GroupSelectReq) (res *cron.GroupSelectRes, err error) { + data, err := service.SysCronGroup().Select(ctx, &req.CronGroupSelectInp) + if err != nil { + return + } + + res = new(cron.GroupSelectRes) + res.CronGroupSelectModel = data + return +} diff --git a/server/internal/controller/admin/sys/curd_demo.go b/server/internal/controller/admin/sys/curd_demo.go new file mode 100644 index 0000000..ace44e3 --- /dev/null +++ b/server/internal/controller/admin/sys/curd_demo.go @@ -0,0 +1,91 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2025 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.18.6 +package sys + +import ( + "context" + "hotgo/api/admin/curddemo" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + CurdDemo = cCurdDemo{} +) + +type cCurdDemo struct{} + +// List 查看CURD列表列表 +func (c *cCurdDemo) List(ctx context.Context, req *curddemo.ListReq) (res *curddemo.ListRes, err error) { + list, totalCount, err := service.SysCurdDemo().List(ctx, &req.CurdDemoListInp) + if err != nil { + return + } + + if list == nil { + list = []*sysin.CurdDemoListModel{} + } + + res = new(curddemo.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出CURD列表列表 +func (c *cCurdDemo) Export(ctx context.Context, req *curddemo.ExportReq) (res *curddemo.ExportRes, err error) { + err = service.SysCurdDemo().Export(ctx, &req.CurdDemoListInp) + return +} + +// Edit 更新CURD列表 +func (c *cCurdDemo) Edit(ctx context.Context, req *curddemo.EditReq) (res *curddemo.EditRes, err error) { + err = service.SysCurdDemo().Edit(ctx, &req.CurdDemoEditInp) + return +} + +// MaxSort 获取CURD列表最大排序 +func (c *cCurdDemo) MaxSort(ctx context.Context, req *curddemo.MaxSortReq) (res *curddemo.MaxSortRes, err error) { + data, err := service.SysCurdDemo().MaxSort(ctx, &req.CurdDemoMaxSortInp) + if err != nil { + return + } + + res = new(curddemo.MaxSortRes) + res.CurdDemoMaxSortModel = data + return +} + +// View 获取指定CURD列表信息 +func (c *cCurdDemo) View(ctx context.Context, req *curddemo.ViewReq) (res *curddemo.ViewRes, err error) { + data, err := service.SysCurdDemo().View(ctx, &req.CurdDemoViewInp) + if err != nil { + return + } + + res = new(curddemo.ViewRes) + res.CurdDemoViewModel = data + return +} + +// Delete 删除CURD列表 +func (c *cCurdDemo) Delete(ctx context.Context, req *curddemo.DeleteReq) (res *curddemo.DeleteRes, err error) { + err = service.SysCurdDemo().Delete(ctx, &req.CurdDemoDeleteInp) + return +} + +// Status 更新CURD列表状态 +func (c *cCurdDemo) Status(ctx context.Context, req *curddemo.StatusReq) (res *curddemo.StatusRes, err error) { + err = service.SysCurdDemo().Status(ctx, &req.CurdDemoStatusInp) + return +} + +// Switch 更新CURD列表开关状态 +func (c *cCurdDemo) Switch(ctx context.Context, req *curddemo.SwitchReq) (res *curddemo.SwitchRes, err error) { + err = service.SysCurdDemo().Switch(ctx, &req.CurdDemoSwitchInp) + return +} \ No newline at end of file diff --git a/server/internal/controller/admin/sys/customer_service.go b/server/internal/controller/admin/sys/customer_service.go new file mode 100644 index 0000000..17b8eed --- /dev/null +++ b/server/internal/controller/admin/sys/customer_service.go @@ -0,0 +1,40 @@ +package sys + +import ( + "context" + + "hotgo/api/admin/customerservice" + "hotgo/internal/model/entity" + "hotgo/internal/service" +) + +var CustomerService = cCustomerService{} + +type cCustomerService struct{} + +func (c *cCustomerService) List(ctx context.Context, req *customerservice.ListReq) (res *customerservice.ListRes, err error) { + list, total, err := service.SysCustomerService().List(ctx, &req.CustomerServiceListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*entity.CustomerService{} + } + res = new(customerservice.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cCustomerService) View(ctx context.Context, req *customerservice.ViewReq) (*customerservice.ViewRes, error) { + v, err := service.SysCustomerService().View(ctx, &req.CustomerServiceViewInp) + return &customerservice.ViewRes{CustomerService: v}, err +} +func (c *cCustomerService) Edit(ctx context.Context, req *customerservice.EditReq) (*customerservice.EditRes, error) { + return &customerservice.EditRes{}, service.SysCustomerService().Edit(ctx, &req.CustomerServiceEditInp) +} +func (c *cCustomerService) Status(ctx context.Context, req *customerservice.StatusReq) (*customerservice.StatusRes, error) { + return &customerservice.StatusRes{}, service.SysCustomerService().Status(ctx, &req.CustomerServiceStatusInp) +} +func (c *cCustomerService) Delete(ctx context.Context, req *customerservice.DeleteReq) (*customerservice.DeleteRes, error) { + return &customerservice.DeleteRes{}, service.SysCustomerService().Delete(ctx, &req.CustomerServiceDeleteInp) +} diff --git a/server/internal/controller/admin/sys/dict_data.go b/server/internal/controller/admin/sys/dict_data.go new file mode 100644 index 0000000..1e067da --- /dev/null +++ b/server/internal/controller/admin/sys/dict_data.go @@ -0,0 +1,68 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/dict" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + DictData = cDictData{} +) + +type cDictData struct{} + +// Delete 删除 +func (c *cDictData) Delete(ctx context.Context, req *dict.DataDeleteReq) (res *dict.DataDeleteRes, err error) { + err = service.SysDictData().Delete(ctx, &req.DictDataDeleteInp) + return +} + +// Edit 更新 +func (c *cDictData) Edit(ctx context.Context, req *dict.DataEditReq) (res *dict.DataEditRes, err error) { + err = service.SysDictData().Edit(ctx, &req.DictDataEditInp) + return +} + +// List 查看列表 +func (c *cDictData) List(ctx context.Context, req *dict.DataListReq) (res *dict.DataListRes, err error) { + list, totalCount, err := service.SysDictData().List(ctx, &req.DictDataListInp) + if err != nil { + return + } + + res = new(dict.DataListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Select 指定选项 +func (c *cDictData) Select(ctx context.Context, req *dict.DataSelectReq) (res dict.DataSelectRes, err error) { + list, err := service.SysDictData().Select(ctx, &req.DataSelectInp) + if err != nil { + return + } + + res = dict.DataSelectRes(list) + return +} + +// Selects 多个选项 +func (c *cDictData) Selects(ctx context.Context, req *dict.DataSelectsReq) (res dict.DataSelectsRes, err error) { + res = make(dict.DataSelectsRes) + for _, v := range req.Types { + option, err := service.SysDictData().Select(ctx, &sysin.DataSelectInp{Type: v}) + if err != nil { + return nil, err + } + res[v] = option + } + return +} diff --git a/server/internal/controller/admin/sys/dict_type.go b/server/internal/controller/admin/sys/dict_type.go new file mode 100644 index 0000000..ededd0a --- /dev/null +++ b/server/internal/controller/admin/sys/dict_type.go @@ -0,0 +1,37 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/dict" + "hotgo/internal/service" +) + +var ( + DictType = cDictType{} +) + +type cDictType struct{} + +// Tree 树 +func (c *cDictType) Tree(ctx context.Context, _ *dict.TypeTreeReq) (res *dict.TypeTreeRes, err error) { + res = new(dict.TypeTreeRes) + res.List, err = service.SysDictType().Tree(ctx) + return +} + +// Delete 删除 +func (c *cDictType) Delete(ctx context.Context, req *dict.TypeDeleteReq) (res *dict.TypeDeleteRes, err error) { + err = service.SysDictType().Delete(ctx, &req.DictTypeDeleteInp) + return +} + +// Edit 更新 +func (c *cDictType) Edit(ctx context.Context, req *dict.TypeEditReq) (res *dict.TypeEditRes, err error) { + err = service.SysDictType().Edit(ctx, &req.DictTypeEditInp) + return +} diff --git a/server/internal/controller/admin/sys/ems_log.go b/server/internal/controller/admin/sys/ems_log.go new file mode 100644 index 0000000..0bea28e --- /dev/null +++ b/server/internal/controller/admin/sys/ems_log.go @@ -0,0 +1,61 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/emslog" + "hotgo/internal/service" +) + +var ( + EmsLog = cEmsLog{} +) + +type cEmsLog struct{} + +// Delete 删除 +func (c *cEmsLog) Delete(ctx context.Context, req *emslog.DeleteReq) (res *emslog.DeleteRes, err error) { + err = service.SysEmsLog().Delete(ctx, &req.EmsLogDeleteInp) + return +} + +// Edit 更新 +func (c *cEmsLog) Edit(ctx context.Context, req *emslog.EditReq) (res *emslog.EditRes, err error) { + err = service.SysEmsLog().Edit(ctx, &req.EmsLogEditInp) + return +} + +// View 获取指定信息 +func (c *cEmsLog) View(ctx context.Context, req *emslog.ViewReq) (res *emslog.ViewRes, err error) { + data, err := service.SysEmsLog().View(ctx, &req.EmsLogViewInp) + if err != nil { + return + } + + res = new(emslog.ViewRes) + res.EmsLogViewModel = data + return +} + +// List 查看列表 +func (c *cEmsLog) List(ctx context.Context, req *emslog.ListReq) (res *emslog.ListRes, err error) { + list, totalCount, err := service.SysEmsLog().List(ctx, &req.EmsLogListInp) + if err != nil { + return + } + + res = new(emslog.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新状态 +func (c *cEmsLog) Status(ctx context.Context, req *emslog.StatusReq) (res *emslog.StatusRes, err error) { + err = service.SysEmsLog().Status(ctx, &req.EmsLogStatusInp) + return +} diff --git a/server/internal/controller/admin/sys/gen_codes.go b/server/internal/controller/admin/sys/gen_codes.go new file mode 100644 index 0000000..44a4631 --- /dev/null +++ b/server/internal/controller/admin/sys/gen_codes.go @@ -0,0 +1,137 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/gencodes" + "hotgo/internal/service" +) + +var ( + GenCodes = cGenCodes{} +) + +type cGenCodes struct{} + +// Delete 删除 +func (c *cGenCodes) Delete(ctx context.Context, req *gencodes.DeleteReq) (res *gencodes.DeleteRes, err error) { + err = service.SysGenCodes().Delete(ctx, &req.GenCodesDeleteInp) + return +} + +// Edit 更新 +func (c *cGenCodes) Edit(ctx context.Context, req *gencodes.EditReq) (res *gencodes.EditRes, err error) { + data, err := service.SysGenCodes().Edit(ctx, &req.GenCodesEditInp) + if err != nil { + return + } + + res = new(gencodes.EditRes) + res.GenCodesEditModel = data + return +} + +// MaxSort 最大排序 +func (c *cGenCodes) MaxSort(ctx context.Context, req *gencodes.MaxSortReq) (res *gencodes.MaxSortRes, err error) { + res = new(gencodes.MaxSortRes) + res.GenCodesMaxSortModel, err = service.SysGenCodes().MaxSort(ctx, &req.GenCodesMaxSortInp) + return +} + +// View 获取指定信息 +func (c *cGenCodes) View(ctx context.Context, req *gencodes.ViewReq) (res *gencodes.ViewRes, err error) { + data, err := service.SysGenCodes().View(ctx, &req.GenCodesViewInp) + if err != nil { + return + } + + res = new(gencodes.ViewRes) + res.GenCodesViewModel = data + return +} + +// List 查看列表 +func (c *cGenCodes) List(ctx context.Context, req *gencodes.ListReq) (res *gencodes.ListRes, err error) { + list, totalCount, err := service.SysGenCodes().List(ctx, &req.GenCodesListInp) + if err != nil { + return + } + + res = new(gencodes.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新状态 +func (c *cGenCodes) Status(ctx context.Context, req *gencodes.StatusReq) (res *gencodes.StatusRes, err error) { + err = service.SysGenCodes().Status(ctx, &req.GenCodesStatusInp) + return +} + +// Selects 获取指定信息 +func (c *cGenCodes) Selects(ctx context.Context, req *gencodes.SelectsReq) (res *gencodes.SelectsRes, err error) { + data, err := service.SysGenCodes().Selects(ctx, &req.GenCodesSelectsInp) + if err != nil { + return + } + + res = new(gencodes.SelectsRes) + res.GenCodesSelectsModel = data + return +} + +// TableSelect 数据库表选项 +func (c *cGenCodes) TableSelect(ctx context.Context, req *gencodes.TableSelectReq) (res *gencodes.TableSelectRes, err error) { + data, err := service.SysGenCodes().TableSelect(ctx, &req.GenCodesTableSelectInp) + if err != nil { + return + } + + res = (*gencodes.TableSelectRes)(&data) + return +} + +// ColumnSelect 表字段选项 +func (c *cGenCodes) ColumnSelect(ctx context.Context, req *gencodes.ColumnSelectReq) (res *gencodes.ColumnSelectRes, err error) { + data, err := service.SysGenCodes().ColumnSelect(ctx, &req.GenCodesColumnSelectInp) + if err != nil { + return + } + + res = (*gencodes.ColumnSelectRes)(&data) + return +} + +// ColumnList 表字段列表 +func (c *cGenCodes) ColumnList(ctx context.Context, req *gencodes.ColumnListReq) (res *gencodes.ColumnListRes, err error) { + data, err := service.SysGenCodes().ColumnList(ctx, &req.GenCodesColumnListInp) + if err != nil { + return + } + + res = (*gencodes.ColumnListRes)(&data) + return +} + +// Preview 生成预览 +func (c *cGenCodes) Preview(ctx context.Context, req *gencodes.PreviewReq) (res *gencodes.PreviewRes, err error) { + data, err := service.SysGenCodes().Preview(ctx, &req.GenCodesPreviewInp) + if err != nil { + return + } + + res = new(gencodes.PreviewRes) + res.GenCodesPreviewModel = data + return +} + +// Build 生成预览 +func (c *cGenCodes) Build(ctx context.Context, req *gencodes.BuildReq) (res *gencodes.BuildRes, err error) { + err = service.SysGenCodes().Build(ctx, &req.GenCodesBuildInp) + return +} diff --git a/server/internal/controller/admin/sys/log.go b/server/internal/controller/admin/sys/log.go new file mode 100644 index 0000000..192a5a5 --- /dev/null +++ b/server/internal/controller/admin/sys/log.go @@ -0,0 +1,56 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "hotgo/api/admin/log" + "hotgo/internal/service" +) + +// Log 日志 +var Log = sLog{} + +type sLog struct{} + +// Clear 清空日志 +func (c *sLog) Clear(ctx context.Context, _ *log.ClearReq) (res *log.ClearRes, err error) { + err = gerror.New("暂时考虑到安全问题,请到数据库清空") + return +} + +// Export 导出 +func (c *sLog) Export(ctx context.Context, req *log.ExportReq) (res *log.ExportRes, err error) { + err = service.SysLog().Export(ctx, &req.LogListInp) + return +} + +// List 获取访问日志列表 +func (c *sLog) List(ctx context.Context, req *log.ListReq) (res *log.ListRes, err error) { + list, totalCount, err := service.SysLog().List(ctx, &req.LogListInp) + if err != nil { + return + } + + res = new(log.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// View 获取指定信息 +func (c *sLog) View(ctx context.Context, req *log.ViewReq) (res *log.ViewRes, err error) { + res = new(log.ViewRes) + res.LogViewModel, err = service.SysLog().View(ctx, &req.LogViewInp) + return +} + +// Delete 删除 +func (c *sLog) Delete(ctx context.Context, req *log.DeleteReq) (res *log.DeleteRes, err error) { + err = service.SysLog().Delete(ctx, &req.LogDeleteInp) + return +} diff --git a/server/internal/controller/admin/sys/login_log.go b/server/internal/controller/admin/sys/login_log.go new file mode 100644 index 0000000..6123c58 --- /dev/null +++ b/server/internal/controller/admin/sys/login_log.go @@ -0,0 +1,45 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.1.1 +// @AutoGenerate Date 2023-01-19 16:57:33 +package sys + +import ( + "context" + "hotgo/api/admin/loginlog" + "hotgo/internal/service" +) + +var ( + LoginLog = cLoginLog{} +) + +type cLoginLog struct{} + +// List 查看登录日志列表 +func (c *cLoginLog) List(ctx context.Context, req *loginlog.ListReq) (res *loginlog.ListRes, err error) { + list, totalCount, err := service.SysLoginLog().List(ctx, &req.LoginLogListInp) + if err != nil { + return + } + + res = new(loginlog.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出登录日志列表 +func (c *cLoginLog) Export(ctx context.Context, req *loginlog.ExportReq) (res *loginlog.ExportRes, err error) { + err = service.SysLoginLog().Export(ctx, &req.LoginLogListInp) + return +} + +// Delete 删除登录日志 +func (c *cLoginLog) Delete(ctx context.Context, req *loginlog.DeleteReq) (res *loginlog.DeleteRes, err error) { + err = service.SysLoginLog().Delete(ctx, &req.LoginLogDeleteInp) + return +} diff --git a/server/internal/controller/admin/sys/member_level.go b/server/internal/controller/admin/sys/member_level.go new file mode 100644 index 0000000..151d785 --- /dev/null +++ b/server/internal/controller/admin/sys/member_level.go @@ -0,0 +1,71 @@ +package sys + +import ( + "context" + "hotgo/api/admin/memberlevel" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var MemberLevel = cMemberLevel{} + +type cMemberLevel struct{} + +func (c *cMemberLevel) List(ctx context.Context, req *memberlevel.ListReq) (res *memberlevel.ListRes, err error) { + list, total, err := service.SysMemberLevel().List(ctx, &req.MemberLevelListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.MemberLevelListModel{} + } + res = new(memberlevel.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cMemberLevel) View(ctx context.Context, req *memberlevel.ViewReq) (res *memberlevel.ViewRes, err error) { + v, err := service.SysMemberLevel().View(ctx, &req.MemberLevelViewInp) + if err != nil { + return + } + return &memberlevel.ViewRes{MemberLevelViewModel: v}, nil +} +func (c *cMemberLevel) Save(ctx context.Context, req *memberlevel.SaveReq) (res *memberlevel.SaveRes, err error) { + id, vid, err := service.SysMemberLevel().Save(ctx, &req.MemberLevelSaveInp) + return &memberlevel.SaveRes{Id: id, VersionId: vid}, err +} +func (c *cMemberLevel) Submit(ctx context.Context, req *memberlevel.SubmitReq) (res *memberlevel.SubmitRes, err error) { + v, err := service.SysMemberLevel().Submit(ctx, &req.MemberLevelSubmitInp) + if err != nil { + return + } + return &memberlevel.SubmitRes{MemberLevelApprovalModel: v}, nil +} +func (c *cMemberLevel) Publish(ctx context.Context, req *memberlevel.PublishReq) (*memberlevel.PublishRes, error) { + return &memberlevel.PublishRes{}, service.SysMemberLevel().Publish(ctx, &req.MemberLevelPublishInp) +} +func (c *cMemberLevel) Rollback(ctx context.Context, req *memberlevel.RollbackReq) (*memberlevel.RollbackRes, error) { + id, err := service.SysMemberLevel().Rollback(ctx, &req.MemberLevelRollbackInp) + return &memberlevel.RollbackRes{VersionId: id}, err +} +func (c *cMemberLevel) History(ctx context.Context, req *memberlevel.HistoryReq) (res *memberlevel.HistoryRes, err error) { + list, total, err := service.SysMemberLevel().History(ctx, &req.MemberLevelHistoryInp) + if err != nil { + return + } + if list == nil { + list = []*entity.AppMemberLevelVersion{} + } + res = new(memberlevel.HistoryRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cMemberLevel) Status(ctx context.Context, req *memberlevel.StatusReq) (*memberlevel.StatusRes, error) { + return &memberlevel.StatusRes{}, service.SysMemberLevel().Status(ctx, &req.MemberLevelStatusInp) +} +func (c *cMemberLevel) Delete(ctx context.Context, req *memberlevel.DeleteReq) (*memberlevel.DeleteRes, error) { + return &memberlevel.DeleteRes{}, service.SysMemberLevel().Delete(ctx, &req.MemberLevelDeleteInp) +} diff --git a/server/internal/controller/admin/sys/normal_tree_demo.go b/server/internal/controller/admin/sys/normal_tree_demo.go new file mode 100644 index 0000000..7348d87 --- /dev/null +++ b/server/internal/controller/admin/sys/normal_tree_demo.go @@ -0,0 +1,89 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.15.7 +package sys + +import ( + "context" + "hotgo/api/admin/normaltreedemo" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + NormalTreeDemo = cNormalTreeDemo{} +) + +type cNormalTreeDemo struct{} + +// List 查看普通树表列表 +func (c *cNormalTreeDemo) List(ctx context.Context, req *normaltreedemo.ListReq) (res *normaltreedemo.ListRes, err error) { + list, totalCount, err := service.SysNormalTreeDemo().List(ctx, &req.NormalTreeDemoListInp) + if err != nil { + return + } + + if list == nil { + list = []*sysin.NormalTreeDemoListModel{} + } + + res = new(normaltreedemo.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Edit 更新普通树表 +func (c *cNormalTreeDemo) Edit(ctx context.Context, req *normaltreedemo.EditReq) (res *normaltreedemo.EditRes, err error) { + err = service.SysNormalTreeDemo().Edit(ctx, &req.NormalTreeDemoEditInp) + return +} + +// MaxSort 获取普通树表最大排序 +func (c *cNormalTreeDemo) MaxSort(ctx context.Context, req *normaltreedemo.MaxSortReq) (res *normaltreedemo.MaxSortRes, err error) { + data, err := service.SysNormalTreeDemo().MaxSort(ctx, &req.NormalTreeDemoMaxSortInp) + if err != nil { + return + } + + res = new(normaltreedemo.MaxSortRes) + res.NormalTreeDemoMaxSortModel = data + return +} + +// View 获取指定普通树表信息 +func (c *cNormalTreeDemo) View(ctx context.Context, req *normaltreedemo.ViewReq) (res *normaltreedemo.ViewRes, err error) { + data, err := service.SysNormalTreeDemo().View(ctx, &req.NormalTreeDemoViewInp) + if err != nil { + return + } + + res = new(normaltreedemo.ViewRes) + res.NormalTreeDemoViewModel = data + return +} + +// Delete 删除普通树表 +func (c *cNormalTreeDemo) Delete(ctx context.Context, req *normaltreedemo.DeleteReq) (res *normaltreedemo.DeleteRes, err error) { + err = service.SysNormalTreeDemo().Delete(ctx, &req.NormalTreeDemoDeleteInp) + return +} + +// TreeOption 获取普通树表关系树选项 +func (c *cNormalTreeDemo) TreeOption(ctx context.Context, req *normaltreedemo.TreeOptionReq) (res *normaltreedemo.TreeOptionRes, err error) { + data, err := service.SysNormalTreeDemo().TreeOption(ctx) + if err != nil { + return nil, err + } + + if len(data) > 0 { + res = (*normaltreedemo.TreeOptionRes)(&data) + } else { + temp := make(normaltreedemo.TreeOptionRes, 0) + res = &temp + } + return +} diff --git a/server/internal/controller/admin/sys/option_tree_demo.go b/server/internal/controller/admin/sys/option_tree_demo.go new file mode 100644 index 0000000..5ec4a1c --- /dev/null +++ b/server/internal/controller/admin/sys/option_tree_demo.go @@ -0,0 +1,89 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2025 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.17.8 +package sys + +import ( + "context" + "hotgo/api/admin/optiontreedemo" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + OptionTreeDemo = cOptionTreeDemo{} +) + +type cOptionTreeDemo struct{} + +// List 查看选项树表列表 +func (c *cOptionTreeDemo) List(ctx context.Context, req *optiontreedemo.ListReq) (res *optiontreedemo.ListRes, err error) { + list, totalCount, err := service.SysOptionTreeDemo().List(ctx, &req.OptionTreeDemoListInp) + if err != nil { + return + } + + if list == nil { + list = []*sysin.OptionTreeDemoListModel{} + } + + res = new(optiontreedemo.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Edit 更新选项树表 +func (c *cOptionTreeDemo) Edit(ctx context.Context, req *optiontreedemo.EditReq) (res *optiontreedemo.EditRes, err error) { + err = service.SysOptionTreeDemo().Edit(ctx, &req.OptionTreeDemoEditInp) + return +} + +// MaxSort 获取选项树表最大排序 +func (c *cOptionTreeDemo) MaxSort(ctx context.Context, req *optiontreedemo.MaxSortReq) (res *optiontreedemo.MaxSortRes, err error) { + data, err := service.SysOptionTreeDemo().MaxSort(ctx, &req.OptionTreeDemoMaxSortInp) + if err != nil { + return + } + + res = new(optiontreedemo.MaxSortRes) + res.OptionTreeDemoMaxSortModel = data + return +} + +// View 获取指定选项树表信息 +func (c *cOptionTreeDemo) View(ctx context.Context, req *optiontreedemo.ViewReq) (res *optiontreedemo.ViewRes, err error) { + data, err := service.SysOptionTreeDemo().View(ctx, &req.OptionTreeDemoViewInp) + if err != nil { + return + } + + res = new(optiontreedemo.ViewRes) + res.OptionTreeDemoViewModel = data + return +} + +// Delete 删除选项树表 +func (c *cOptionTreeDemo) Delete(ctx context.Context, req *optiontreedemo.DeleteReq) (res *optiontreedemo.DeleteRes, err error) { + err = service.SysOptionTreeDemo().Delete(ctx, &req.OptionTreeDemoDeleteInp) + return +} + +// TreeOption 获取选项树表关系树选项 +func (c *cOptionTreeDemo) TreeOption(ctx context.Context, req *optiontreedemo.TreeOptionReq) (res *optiontreedemo.TreeOptionRes, err error) { + data, err := service.SysOptionTreeDemo().TreeOption(ctx) + if err != nil { + return nil, err + } + + if len(data) > 0 { + res = (*optiontreedemo.TreeOptionRes)(&data) + } else { + temp := make(optiontreedemo.TreeOptionRes, 0) + res = &temp + } + return +} \ No newline at end of file diff --git a/server/internal/controller/admin/sys/portal.go b/server/internal/controller/admin/sys/portal.go new file mode 100644 index 0000000..8c387ff --- /dev/null +++ b/server/internal/controller/admin/sys/portal.go @@ -0,0 +1,168 @@ +package sys + +import ( + "context" + "hotgo/api/admin/portal" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var Portal = cPortal{} + +type cPortal struct{} + +func (c *cPortal) SiteConfigCurrent(ctx context.Context, req *portal.SiteConfigCurrentReq) (res *portal.SiteConfigCurrentRes, err error) { + data, err := service.SysPortal().SiteConfigCurrent(ctx, &req.SiteConfigCurrentInp) + if err != nil { + return + } + res = &portal.SiteConfigCurrentRes{SiteConfigCurrentModel: data} + return +} +func (c *cPortal) SiteConfigHistory(ctx context.Context, req *portal.SiteConfigHistoryReq) (res *portal.SiteConfigHistoryRes, err error) { + list, total, err := service.SysPortal().SiteConfigHistory(ctx, &req.SiteConfigHistoryInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.SiteConfigHistoryModel{} + } + res = new(portal.SiteConfigHistoryRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cPortal) SiteConfigSave(ctx context.Context, req *portal.SiteConfigSaveReq) (res *portal.SiteConfigSaveRes, err error) { + id, err := service.SysPortal().SiteConfigSave(ctx, &req.SiteConfigSaveInp) + if err == nil { + res = &portal.SiteConfigSaveRes{Id: id} + } + return +} +func (c *cPortal) SiteConfigSubmit(ctx context.Context, req *portal.SiteConfigSubmitReq) (res *portal.SiteConfigSubmitRes, err error) { + data, err := service.SysPortal().SiteConfigSubmit(ctx, &req.SiteConfigSubmitInp) + if err == nil { + res = &portal.SiteConfigSubmitRes{PortalApprovalModel: data} + } + return +} +func (c *cPortal) SiteConfigPublish(ctx context.Context, req *portal.SiteConfigPublishReq) (res *portal.SiteConfigPublishRes, err error) { + err = service.SysPortal().SiteConfigPublish(ctx, &req.SiteConfigPublishInp) + return +} +func (c *cPortal) SiteConfigRollback(ctx context.Context, req *portal.SiteConfigRollbackReq) (res *portal.SiteConfigRollbackRes, err error) { + id, err := service.SysPortal().SiteConfigRollback(ctx, &req.SiteConfigRollbackInp) + if err == nil { + res = &portal.SiteConfigRollbackRes{Id: id} + } + return +} +func (c *cPortal) ContentList(ctx context.Context, req *portal.ContentListReq) (res *portal.ContentListRes, err error) { + list, total, err := service.SysPortal().ContentList(ctx, &req.ContentListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.ContentListModel{} + } + res = new(portal.ContentListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cPortal) ContentView(ctx context.Context, req *portal.ContentViewReq) (res *portal.ContentViewRes, err error) { + data, err := service.SysPortal().ContentView(ctx, &req.ContentViewInp) + if err == nil { + res = &portal.ContentViewRes{ContentViewModel: data} + } + return +} +func (c *cPortal) ContentEdit(ctx context.Context, req *portal.ContentEditReq) (res *portal.ContentEditRes, err error) { + id, err := service.SysPortal().ContentEdit(ctx, &req.ContentEditInp) + if err == nil { + res = &portal.ContentEditRes{Id: id} + } + return +} +func (c *cPortal) ContentDelete(ctx context.Context, req *portal.ContentDeleteReq) (res *portal.ContentDeleteRes, err error) { + err = service.SysPortal().ContentDelete(ctx, &req.ContentDeleteInp) + return +} +func (c *cPortal) ContentPublish(ctx context.Context, req *portal.ContentPublishReq) (res *portal.ContentPublishRes, err error) { + err = service.SysPortal().ContentPublish(ctx, &req.ContentPublishInp) + return +} +func (c *cPortal) ContentOffline(ctx context.Context, req *portal.ContentOfflineReq) (res *portal.ContentOfflineRes, err error) { + err = service.SysPortal().ContentOffline(ctx, &req.ContentOfflineInp) + return +} +func (c *cPortal) BannerList(ctx context.Context, req *portal.BannerListReq) (res *portal.BannerListRes, err error) { + list, total, err := service.SysPortal().BannerList(ctx, &req.BannerListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.BannerListModel{} + } + res = new(portal.BannerListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cPortal) BannerView(ctx context.Context, req *portal.BannerViewReq) (res *portal.BannerViewRes, err error) { + data, err := service.SysPortal().BannerView(ctx, &req.BannerViewInp) + if err == nil { + res = &portal.BannerViewRes{Banner: data} + } + return +} +func (c *cPortal) BannerEdit(ctx context.Context, req *portal.BannerEditReq) (res *portal.BannerEditRes, err error) { + id, err := service.SysPortal().BannerEdit(ctx, &req.BannerEditInp) + if err == nil { + res = &portal.BannerEditRes{Id: id} + } + return +} +func (c *cPortal) BannerDelete(ctx context.Context, req *portal.BannerDeleteReq) (res *portal.BannerDeleteRes, err error) { + err = service.SysPortal().BannerDelete(ctx, &req.BannerDeleteInp) + return +} +func (c *cPortal) BannerStatus(ctx context.Context, req *portal.BannerStatusReq) (res *portal.BannerStatusRes, err error) { + err = service.SysPortal().BannerStatus(ctx, &req.BannerStatusInp) + return +} +func (c *cPortal) ManualProductList(ctx context.Context, req *portal.ManualProductListReq) (res *portal.ManualProductListRes, err error) { + list, total, err := service.SysPortal().ManualProductList(ctx, &req.ManualProductListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.ManualProductListModel{} + } + res = new(portal.ManualProductListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cPortal) ManualProductView(ctx context.Context, req *portal.ManualProductViewReq) (res *portal.ManualProductViewRes, err error) { + data, err := service.SysPortal().ManualProductView(ctx, &req.ManualProductViewInp) + if err == nil { + res = &portal.ManualProductViewRes{ManualProductViewModel: data} + } + return +} +func (c *cPortal) ManualProductEdit(ctx context.Context, req *portal.ManualProductEditReq) (res *portal.ManualProductEditRes, err error) { + id, err := service.SysPortal().ManualProductEdit(ctx, &req.ManualProductEditInp) + if err == nil { + res = &portal.ManualProductEditRes{Id: id} + } + return +} +func (c *cPortal) ManualProductDelete(ctx context.Context, req *portal.ManualProductDeleteReq) (res *portal.ManualProductDeleteRes, err error) { + err = service.SysPortal().ManualProductDelete(ctx, &req.ManualProductDeleteInp) + return +} +func (c *cPortal) ManualProductStatus(ctx context.Context, req *portal.ManualProductStatusReq) (res *portal.ManualProductStatusRes, err error) { + err = service.SysPortal().ManualProductStatus(ctx, &req.ManualProductStatusInp) + return +} diff --git a/server/internal/controller/admin/sys/product.go b/server/internal/controller/admin/sys/product.go new file mode 100644 index 0000000..c0bacdd --- /dev/null +++ b/server/internal/controller/admin/sys/product.go @@ -0,0 +1,52 @@ +package sys + +import ( + "context" + "hotgo/api/admin/product" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var Product = cProduct{} + +type cProduct struct{} + +func (c *cProduct) List(ctx context.Context, req *product.ListReq) (res *product.ListRes, err error) { + list, total, err := service.SysProduct().List(ctx, &req.ProductListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.ProductListModel{} + } + res = new(product.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cProduct) View(ctx context.Context, req *product.ViewReq) (res *product.ViewRes, err error) { + data, err := service.SysProduct().View(ctx, &req.ProductViewInp) + if err == nil { + res = &product.ViewRes{ProductListModel: data} + } + return res, err +} +func (c *cProduct) Edit(ctx context.Context, req *product.EditReq) (res *product.EditRes, err error) { + id, err := service.SysProduct().Edit(ctx, &req.ProductEditInp) + if err == nil { + res = &product.EditRes{Id: id} + } + return res, err +} +func (c *cProduct) Status(ctx context.Context, req *product.StatusReq) (res *product.StatusRes, err error) { + err = service.SysProduct().Status(ctx, &req.ProductStatusInp) + return +} +func (c *cProduct) Recommend(ctx context.Context, req *product.RecommendReq) (res *product.RecommendRes, err error) { + err = service.SysProduct().Recommend(ctx, &req.ProductRecommendInp) + return +} +func (c *cProduct) Delete(ctx context.Context, req *product.DeleteReq) (res *product.DeleteRes, err error) { + err = service.SysProduct().Delete(ctx, &req.ProductDeleteInp) + return +} diff --git a/server/internal/controller/admin/sys/provinces.go b/server/internal/controller/admin/sys/provinces.go new file mode 100644 index 0000000..318a423 --- /dev/null +++ b/server/internal/controller/admin/sys/provinces.go @@ -0,0 +1,129 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/provinces" + "hotgo/internal/library/location" + "hotgo/internal/service" +) + +var ( + Provinces = cProvinces{} +) + +type cProvinces struct{} + +// Tree 关系树选项列表 +func (c *cProvinces) Tree(ctx context.Context, _ *provinces.TreeReq) (res *provinces.TreeRes, err error) { + res = new(provinces.TreeRes) + res.List, err = service.SysProvinces().Tree(ctx) + return +} + +// Delete 删除 +func (c *cProvinces) Delete(ctx context.Context, req *provinces.DeleteReq) (res *provinces.DeleteRes, err error) { + err = service.SysProvinces().Delete(ctx, &req.ProvincesDeleteInp) + return +} + +// Edit 更新 +func (c *cProvinces) Edit(ctx context.Context, req *provinces.EditReq) (res *provinces.EditRes, err error) { + err = service.SysProvinces().Edit(ctx, &req.ProvincesEditInp) + return +} + +// MaxSort 最大排序 +func (c *cProvinces) MaxSort(ctx context.Context, req *provinces.MaxSortReq) (res *provinces.MaxSortRes, err error) { + data, err := service.SysProvinces().MaxSort(ctx, &req.ProvincesMaxSortInp) + if err != nil { + return + } + + res = new(provinces.MaxSortRes) + res.ProvincesMaxSortModel = data + return +} + +// View 获取指定信息 +func (c *cProvinces) View(ctx context.Context, req *provinces.ViewReq) (res *provinces.ViewRes, err error) { + data, err := service.SysProvinces().View(ctx, &req.ProvincesViewInp) + if err != nil { + return + } + + res = new(provinces.ViewRes) + res.ProvincesViewModel = data + return +} + +// List 查看列表 +func (c *cProvinces) List(ctx context.Context, req *provinces.ListReq) (res *provinces.ListRes, err error) { + list, totalCount, err := service.SysProvinces().List(ctx, &req.ProvincesListInp) + if err != nil { + return + } + + res = new(provinces.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新省市区状态 +func (c *cProvinces) Status(ctx context.Context, req *provinces.StatusReq) (res *provinces.StatusRes, err error) { + err = service.SysProvinces().Status(ctx, &req.ProvincesStatusInp) + return +} + +// ChildrenList 获取省市区下级列表 +func (c *cProvinces) ChildrenList(ctx context.Context, req *provinces.ChildrenListReq) (res *provinces.ChildrenListRes, err error) { + list, totalCount, err := service.SysProvinces().ChildrenList(ctx, &req.ProvincesChildrenListInp) + if err != nil { + return + } + + res = new(provinces.ChildrenListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// UniqueId 地区ID是否唯一 +func (c *cProvinces) UniqueId(ctx context.Context, req *provinces.UniqueIdReq) (res *provinces.UniqueIdRes, err error) { + data, err := service.SysProvinces().UniqueId(ctx, &req.ProvincesUniqueIdInp) + if err != nil { + return + } + + res = new(provinces.UniqueIdRes) + res.ProvincesUniqueIdModel = data + return +} + +// Select 省市区选项 +func (c *cProvinces) Select(ctx context.Context, req *provinces.SelectReq) (res *provinces.SelectRes, err error) { + data, err := service.SysProvinces().Select(ctx, &req.ProvincesSelectInp) + if err != nil { + return + } + + res = new(provinces.SelectRes) + res.ProvincesSelectModel = data + return +} + +// CityLabel 省市区选项 +func (c *cProvinces) CityLabel(ctx context.Context, req *provinces.CityLabelReq) (res *provinces.CityLabelRes, err error) { + cityLabel, err := location.ParseSimpleRegion(ctx, req.Id, req.Spilt) + if err != nil { + return + } + + res = (*provinces.CityLabelRes)(&cityLabel) + return +} diff --git a/server/internal/controller/admin/sys/recharge_order.go b/server/internal/controller/admin/sys/recharge_order.go new file mode 100644 index 0000000..ff55c87 --- /dev/null +++ b/server/internal/controller/admin/sys/recharge_order.go @@ -0,0 +1,42 @@ +package sys + +import ( + "context" + + "hotgo/api/admin/rechargeorder" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var RechargeOrder = cRechargeOrder{} + +type cRechargeOrder struct{} + +func (c *cRechargeOrder) List(ctx context.Context, req *rechargeorder.ListReq) (res *rechargeorder.ListRes, err error) { + list, total, err := service.SysRechargeOrder().List(ctx, &req.RechargeOrderListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.RechargeOrderListModel{} + } + res = new(rechargeorder.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cRechargeOrder) Summary(ctx context.Context, req *rechargeorder.SummaryReq) (*rechargeorder.SummaryRes, error) { + v, err := service.SysRechargeOrder().Summary(ctx, &req.RechargeOrderListInp) + return &rechargeorder.SummaryRes{RechargeSummaryModel: v}, err +} +func (c *cRechargeOrder) View(ctx context.Context, req *rechargeorder.ViewReq) (*rechargeorder.ViewRes, error) { + v, err := service.SysRechargeOrder().View(ctx, &req.RechargeOrderViewInp) + return &rechargeorder.ViewRes{RechargeOrderListModel: v}, err +} +func (c *cRechargeOrder) Review(ctx context.Context, req *rechargeorder.ReviewReq) (*rechargeorder.ReviewRes, error) { + v, err := service.SysRechargeOrder().Review(ctx, &req.RechargeReviewInp) + return &rechargeorder.ReviewRes{FinanceApprovalModel: v}, err +} +func (c *cRechargeOrder) Execute(ctx context.Context, req *rechargeorder.ExecuteReq) (*rechargeorder.ExecuteRes, error) { + return &rechargeorder.ExecuteRes{}, service.SysRechargeOrder().Execute(ctx, &req.FinanceExecuteInp) +} diff --git a/server/internal/controller/admin/sys/serve_license.go b/server/internal/controller/admin/sys/serve_license.go new file mode 100644 index 0000000..5dd94d3 --- /dev/null +++ b/server/internal/controller/admin/sys/serve_license.go @@ -0,0 +1,74 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.7.6 +package sys + +import ( + "context" + "hotgo/api/admin/servelicense" + "hotgo/internal/service" +) + +var ( + ServeLicense = cServeLicense{} +) + +type cServeLicense struct{} + +// List 查看服务授权许可列表 +func (c *cServeLicense) List(ctx context.Context, req *servelicense.ListReq) (res *servelicense.ListRes, err error) { + list, totalCount, err := service.SysServeLicense().List(ctx, &req.ServeLicenseListInp) + if err != nil { + return + } + + res = new(servelicense.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出服务授权许可列表 +func (c *cServeLicense) Export(ctx context.Context, req *servelicense.ExportReq) (res *servelicense.ExportRes, err error) { + err = service.SysServeLicense().Export(ctx, &req.ServeLicenseListInp) + return +} + +// Edit 更新服务授权许可 +func (c *cServeLicense) Edit(ctx context.Context, req *servelicense.EditReq) (res *servelicense.EditRes, err error) { + err = service.SysServeLicense().Edit(ctx, &req.ServeLicenseEditInp) + return +} + +// View 获取指定服务授权许可信息 +func (c *cServeLicense) View(ctx context.Context, req *servelicense.ViewReq) (res *servelicense.ViewRes, err error) { + data, err := service.SysServeLicense().View(ctx, &req.ServeLicenseViewInp) + if err != nil { + return + } + + res = new(servelicense.ViewRes) + res.ServeLicenseViewModel = data + return +} + +// Delete 删除服务授权许可 +func (c *cServeLicense) Delete(ctx context.Context, req *servelicense.DeleteReq) (res *servelicense.DeleteRes, err error) { + err = service.SysServeLicense().Delete(ctx, &req.ServeLicenseDeleteInp) + return +} + +// Status 更新服务授权许可状态 +func (c *cServeLicense) Status(ctx context.Context, req *servelicense.StatusReq) (res *servelicense.StatusRes, err error) { + err = service.SysServeLicense().Status(ctx, &req.ServeLicenseStatusInp) + return +} + +// AssignRouter 分配服务授权许可路由 +func (c *cServeLicense) AssignRouter(ctx context.Context, req *servelicense.AssignRouterReq) (res *servelicense.AssignRouterRes, err error) { + err = service.SysServeLicense().AssignRouter(ctx, &req.ServeLicenseAssignRouterInp) + return +} diff --git a/server/internal/controller/admin/sys/serve_log.go b/server/internal/controller/admin/sys/serve_log.go new file mode 100644 index 0000000..b3ca4cf --- /dev/null +++ b/server/internal/controller/admin/sys/serve_log.go @@ -0,0 +1,55 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/servelog" + "hotgo/internal/service" +) + +var ( + ServeLog = cServeLog{} +) + +type cServeLog struct{} + +// List 查看服务日志列表 +func (c *cServeLog) List(ctx context.Context, req *servelog.ListReq) (res *servelog.ListRes, err error) { + list, totalCount, err := service.SysServeLog().List(ctx, &req.ServeLogListInp) + if err != nil { + return + } + + res = new(servelog.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出服务日志列表 +func (c *cServeLog) Export(ctx context.Context, req *servelog.ExportReq) (res *servelog.ExportRes, err error) { + err = service.SysServeLog().Export(ctx, &req.ServeLogListInp) + return +} + +// View 获取指定服务日志信息 +func (c *cServeLog) View(ctx context.Context, req *servelog.ViewReq) (res *servelog.ViewRes, err error) { + data, err := service.SysServeLog().View(ctx, &req.ServeLogViewInp) + if err != nil { + return + } + + res = new(servelog.ViewRes) + res.ServeLogViewModel = data + return +} + +// Delete 删除服务日志 +func (c *cServeLog) Delete(ctx context.Context, req *servelog.DeleteReq) (res *servelog.DeleteRes, err error) { + err = service.SysServeLog().Delete(ctx, &req.ServeLogDeleteInp) + return +} diff --git a/server/internal/controller/admin/sys/sms_log.go b/server/internal/controller/admin/sys/sms_log.go new file mode 100644 index 0000000..b718efb --- /dev/null +++ b/server/internal/controller/admin/sys/sms_log.go @@ -0,0 +1,49 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package sys + +import ( + "context" + "hotgo/api/admin/smslog" + "hotgo/internal/service" +) + +var ( + SmsLog = cSmsLog{} +) + +type cSmsLog struct{} + +// Delete 删除 +func (c *cSmsLog) Delete(ctx context.Context, req *smslog.DeleteReq) (res *smslog.DeleteRes, err error) { + err = service.SysSmsLog().Delete(ctx, &req.SmsLogDeleteInp) + return +} + +// View 获取指定信息 +func (c *cSmsLog) View(ctx context.Context, req *smslog.ViewReq) (res *smslog.ViewRes, err error) { + data, err := service.SysSmsLog().View(ctx, &req.SmsLogViewInp) + if err != nil { + return + } + + res = new(smslog.ViewRes) + res.SmsLogViewModel = data + return +} + +// List 查看列表 +func (c *cSmsLog) List(ctx context.Context, req *smslog.ListReq) (res *smslog.ListRes, err error) { + list, totalCount, err := service.SysSmsLog().List(ctx, &req.SmsLogListInp) + if err != nil { + return + } + + res = new(smslog.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} diff --git a/server/internal/controller/admin/sys/task.go b/server/internal/controller/admin/sys/task.go new file mode 100644 index 0000000..3afad16 --- /dev/null +++ b/server/internal/controller/admin/sys/task.go @@ -0,0 +1,48 @@ +package sys + +import ( + "context" + "hotgo/api/admin/task" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var Task = cTask{} + +type cTask struct{} + +func (c *cTask) List(ctx context.Context, req *task.ListReq) (res *task.ListRes, err error) { + list, total, err := service.SysTask().List(ctx, &req.TaskListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.TaskListModel{} + } + res = new(task.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cTask) View(ctx context.Context, req *task.ViewReq) (res *task.ViewRes, err error) { + data, err := service.SysTask().View(ctx, &req.TaskViewInp) + if err == nil { + res = &task.ViewRes{TaskListModel: data} + } + return res, err +} +func (c *cTask) Edit(ctx context.Context, req *task.EditReq) (res *task.EditRes, err error) { + id, err := service.SysTask().Edit(ctx, &req.TaskEditInp) + if err == nil { + res = &task.EditRes{Id: id} + } + return res, err +} +func (c *cTask) Status(ctx context.Context, req *task.StatusReq) (res *task.StatusRes, err error) { + err = service.SysTask().Status(ctx, &req.TaskStatusInp) + return +} +func (c *cTask) Delete(ctx context.Context, req *task.DeleteReq) (res *task.DeleteRes, err error) { + err = service.SysTask().Delete(ctx, &req.TaskDeleteInp) + return +} diff --git a/server/internal/controller/admin/sys/task_hall.go b/server/internal/controller/admin/sys/task_hall.go new file mode 100644 index 0000000..60306ea --- /dev/null +++ b/server/internal/controller/admin/sys/task_hall.go @@ -0,0 +1,42 @@ +package sys + +import ( + "context" + "hotgo/api/admin/taskhall" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var TaskHall = cTaskHall{} + +type cTaskHall struct{} + +func (c *cTaskHall) List(ctx context.Context, req *taskhall.ListReq) (res *taskhall.ListRes, err error) { + list, total, err := service.SysTaskHall().List(ctx, &req.TaskHallListInp) + if err != nil { + return + } + if list == nil { + list = []*sysin.TaskHallListModel{} + } + res = new(taskhall.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cTaskHall) View(ctx context.Context, req *taskhall.ViewReq) (res *taskhall.ViewRes, err error) { + v, err := service.SysTaskHall().View(ctx, &req.TaskHallViewInp) + if err != nil { + return + } + return &taskhall.ViewRes{TaskHallListModel: v}, nil +} +func (c *cTaskHall) Edit(ctx context.Context, req *taskhall.EditReq) (*taskhall.EditRes, error) { + return &taskhall.EditRes{}, service.SysTaskHall().Edit(ctx, &req.TaskHallEditInp) +} +func (c *cTaskHall) Status(ctx context.Context, req *taskhall.StatusReq) (*taskhall.StatusRes, error) { + return &taskhall.StatusRes{}, service.SysTaskHall().Status(ctx, &req.TaskHallStatusInp) +} +func (c *cTaskHall) Delete(ctx context.Context, req *taskhall.DeleteReq) (*taskhall.DeleteRes, error) { + return &taskhall.DeleteRes{}, service.SysTaskHall().Delete(ctx, &req.TaskHallDeleteInp) +} diff --git a/server/internal/controller/admin/sys/task_submission.go b/server/internal/controller/admin/sys/task_submission.go new file mode 100644 index 0000000..80ff33d --- /dev/null +++ b/server/internal/controller/admin/sys/task_submission.go @@ -0,0 +1,37 @@ +package sys + +import ( + "context" + "hotgo/api/admin/tasksubmission" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var TaskSubmission = cTaskSubmission{} + +type cTaskSubmission struct{} + +func (c *cTaskSubmission) List(ctx context.Context, req *tasksubmission.ListReq) (res *tasksubmission.ListRes, err error) { + list, total, err := service.SysTaskSubmission().List(ctx, &req.TaskSubmissionListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.TaskSubmissionListModel{} + } + res = new(tasksubmission.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cTaskSubmission) View(ctx context.Context, req *tasksubmission.ViewReq) (res *tasksubmission.ViewRes, err error) { + data, err := service.SysTaskSubmission().View(ctx, &req.TaskSubmissionViewInp) + if err == nil { + res = &tasksubmission.ViewRes{TaskSubmissionListModel: data} + } + return res, err +} +func (c *cTaskSubmission) Review(ctx context.Context, req *tasksubmission.ReviewReq) (res *tasksubmission.ReviewRes, err error) { + err = service.SysTaskSubmission().Review(ctx, &req.TaskSubmissionReviewInp) + return +} diff --git a/server/internal/controller/admin/sys/test_category.go b/server/internal/controller/admin/sys/test_category.go new file mode 100644 index 0000000..72213f3 --- /dev/null +++ b/server/internal/controller/admin/sys/test_category.go @@ -0,0 +1,79 @@ +// Package sys +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.15.7 +package sys + +import ( + "context" + "hotgo/api/admin/testcategory" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var ( + TestCategory = cTestCategory{} +) + +type cTestCategory struct{} + +// List 查看测试分类列表 +func (c *cTestCategory) List(ctx context.Context, req *testcategory.ListReq) (res *testcategory.ListRes, err error) { + list, totalCount, err := service.SysTestCategory().List(ctx, &req.TestCategoryListInp) + if err != nil { + return + } + + if list == nil { + list = []*sysin.TestCategoryListModel{} + } + + res = new(testcategory.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Edit 更新测试分类 +func (c *cTestCategory) Edit(ctx context.Context, req *testcategory.EditReq) (res *testcategory.EditRes, err error) { + err = service.SysTestCategory().Edit(ctx, &req.TestCategoryEditInp) + return +} + +// MaxSort 获取测试分类最大排序 +func (c *cTestCategory) MaxSort(ctx context.Context, req *testcategory.MaxSortReq) (res *testcategory.MaxSortRes, err error) { + data, err := service.SysTestCategory().MaxSort(ctx, &req.TestCategoryMaxSortInp) + if err != nil { + return + } + + res = new(testcategory.MaxSortRes) + res.TestCategoryMaxSortModel = data + return +} + +// View 获取指定测试分类信息 +func (c *cTestCategory) View(ctx context.Context, req *testcategory.ViewReq) (res *testcategory.ViewRes, err error) { + data, err := service.SysTestCategory().View(ctx, &req.TestCategoryViewInp) + if err != nil { + return + } + + res = new(testcategory.ViewRes) + res.TestCategoryViewModel = data + return +} + +// Delete 删除测试分类 +func (c *cTestCategory) Delete(ctx context.Context, req *testcategory.DeleteReq) (res *testcategory.DeleteRes, err error) { + err = service.SysTestCategory().Delete(ctx, &req.TestCategoryDeleteInp) + return +} + +// Status 更新测试分类状态 +func (c *cTestCategory) Status(ctx context.Context, req *testcategory.StatusReq) (res *testcategory.StatusRes, err error) { + err = service.SysTestCategory().Status(ctx, &req.TestCategoryStatusInp) + return +} diff --git a/server/internal/controller/admin/sys/trade_order.go b/server/internal/controller/admin/sys/trade_order.go new file mode 100644 index 0000000..aa14bc5 --- /dev/null +++ b/server/internal/controller/admin/sys/trade_order.go @@ -0,0 +1,54 @@ +package sys + +import ( + "context" + + "hotgo/api/admin/tradeorder" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var TradeOrder = cTradeOrder{} + +type cTradeOrder struct{} + +func (c *cTradeOrder) List(ctx context.Context, req *tradeorder.ListReq) (res *tradeorder.ListRes, err error) { + list, total, err := service.SysTradeOrder().List(ctx, &req.TradeOrderListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.TradeOrderListModel{} + } + res = new(tradeorder.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cTradeOrder) View(ctx context.Context, req *tradeorder.ViewReq) (*tradeorder.ViewRes, error) { + v, err := service.SysTradeOrder().View(ctx, &req.TradeOrderViewInp) + return &tradeorder.ViewRes{TradeOrderViewModel: v}, err +} +func (c *cTradeOrder) MatchProducts(ctx context.Context, req *tradeorder.MatchProductsReq) (res *tradeorder.MatchProductsRes, err error) { + list, total, err := service.SysTradeOrder().MatchProducts(ctx, &req.TradeOrderMatchProductListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.TradeOrderMatchProductModel{} + } + res = new(tradeorder.MatchProductsRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cTradeOrder) Match(ctx context.Context, req *tradeorder.MatchReq) (*tradeorder.MatchRes, error) { + return &tradeorder.MatchRes{}, service.SysTradeOrder().Match(ctx, &req.TradeOrderMatchInp) +} +func (c *cTradeOrder) Apply(ctx context.Context, req *tradeorder.ApplyReq) (*tradeorder.ApplyRes, error) { + v, err := service.SysTradeOrder().Apply(ctx, &req.TradeOrderApplyInp) + return &tradeorder.ApplyRes{FinanceApprovalModel: v}, err +} +func (c *cTradeOrder) Execute(ctx context.Context, req *tradeorder.ExecuteReq) (*tradeorder.ExecuteRes, error) { + return &tradeorder.ExecuteRes{}, service.SysTradeOrder().Execute(ctx, &req.TradeOrderExecuteInp) +} diff --git a/server/internal/controller/admin/sys/withdrawal_order.go b/server/internal/controller/admin/sys/withdrawal_order.go new file mode 100644 index 0000000..0cf6ec1 --- /dev/null +++ b/server/internal/controller/admin/sys/withdrawal_order.go @@ -0,0 +1,41 @@ +package sys + +import ( + "context" + + "hotgo/api/admin/withdrawalorder" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var WithdrawalOrder = cWithdrawalOrder{} + +type cWithdrawalOrder struct{} + +func (c *cWithdrawalOrder) List(ctx context.Context, req *withdrawalorder.ListReq) (res *withdrawalorder.ListRes, err error) { + list, total, err := service.SysWithdrawalOrder().List(ctx, &req.WithdrawalOrderListInp) + if err != nil { + return nil, err + } + if list == nil { + list = []*sysin.WithdrawalOrderListModel{} + } + res = new(withdrawalorder.ListRes) + res.List = list + res.PageRes.Pack(req, total) + return +} +func (c *cWithdrawalOrder) View(ctx context.Context, req *withdrawalorder.ViewReq) (*withdrawalorder.ViewRes, error) { + v, err := service.SysWithdrawalOrder().View(ctx, &req.WithdrawalOrderViewInp) + return &withdrawalorder.ViewRes{WithdrawalOrderListModel: v}, err +} +func (c *cWithdrawalOrder) Review(ctx context.Context, req *withdrawalorder.ReviewReq) (*withdrawalorder.ReviewRes, error) { + v, err := service.SysWithdrawalOrder().Review(ctx, &req.WithdrawalReviewInp) + return &withdrawalorder.ReviewRes{FinanceApprovalModel: v}, err +} +func (c *cWithdrawalOrder) Execute(ctx context.Context, req *withdrawalorder.ExecuteReq) (*withdrawalorder.ExecuteRes, error) { + return &withdrawalorder.ExecuteRes{}, service.SysWithdrawalOrder().Execute(ctx, &req.FinanceExecuteInp) +} +func (c *cWithdrawalOrder) Complete(ctx context.Context, req *withdrawalorder.CompleteReq) (*withdrawalorder.CompleteRes, error) { + return &withdrawalorder.CompleteRes{}, service.SysWithdrawalOrder().Complete(ctx, &req.WithdrawalCompleteInp) +} diff --git a/server/internal/controller/api/member/member.go b/server/internal/controller/api/member/member.go new file mode 100644 index 0000000..6fe3c71 --- /dev/null +++ b/server/internal/controller/api/member/member.go @@ -0,0 +1,5 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package member diff --git a/server/internal/controller/api/member/member_new.go b/server/internal/controller/api/member/member_new.go new file mode 100644 index 0000000..dfb4e71 --- /dev/null +++ b/server/internal/controller/api/member/member_new.go @@ -0,0 +1,15 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package member + +import ( + "hotgo/api/api/member" +) + +type ControllerV1 struct{} + +func NewV1() member.IMemberV1 { + return &ControllerV1{} +} diff --git a/server/internal/controller/api/member/member_v1_get_id_by_code.go b/server/internal/controller/api/member/member_v1_get_id_by_code.go new file mode 100644 index 0000000..42010d3 --- /dev/null +++ b/server/internal/controller/api/member/member_v1_get_id_by_code.go @@ -0,0 +1,14 @@ +package member + +import ( + "context" + + v1 "hotgo/api/api/member/v1" + + "github.com/gogf/gf/v2/frame/g" +) + +func (c *ControllerV1) GetIdByCode(ctx context.Context, req *v1.GetIdByCodeReq) (res *v1.GetIdByCodeRes, err error) { + g.RequestFromCtx(ctx).Response.Writeln("Hello World api member!") + return +} diff --git a/server/internal/controller/api/pay/pay.go b/server/internal/controller/api/pay/pay.go new file mode 100644 index 0000000..cc269a0 --- /dev/null +++ b/server/internal/controller/api/pay/pay.go @@ -0,0 +1,5 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package pay diff --git a/server/internal/controller/api/pay/pay_new.go b/server/internal/controller/api/pay/pay_new.go new file mode 100644 index 0000000..53eb435 --- /dev/null +++ b/server/internal/controller/api/pay/pay_new.go @@ -0,0 +1,15 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package pay + +import ( + "hotgo/api/api/pay" +) + +type ControllerV1 struct{} + +func NewV1() pay.IPayV1 { + return &ControllerV1{} +} diff --git a/server/internal/controller/api/pay/pay_v1_notify_ali_pay.go b/server/internal/controller/api/pay/pay_v1_notify_ali_pay.go new file mode 100644 index 0000000..5e22899 --- /dev/null +++ b/server/internal/controller/api/pay/pay_v1_notify_ali_pay.go @@ -0,0 +1,22 @@ +package pay + +import ( + "context" + + v1 "hotgo/api/api/pay/v1" + "hotgo/internal/consts" + "hotgo/internal/library/response" + "hotgo/internal/model/input/payin" + "hotgo/internal/service" + + "github.com/gogf/gf/v2/frame/g" +) + +func (c *ControllerV1) NotifyAliPay(ctx context.Context, req *v1.NotifyAliPayReq) (res *v1.NotifyAliPayRes, err error) { + if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeAliPay}); err != nil { + return nil, err + } + + response.RText(g.RequestFromCtx(ctx), "success") + return +} diff --git a/server/internal/controller/api/pay/pay_v1_notify_qq_pay.go b/server/internal/controller/api/pay/pay_v1_notify_qq_pay.go new file mode 100644 index 0000000..6c93b03 --- /dev/null +++ b/server/internal/controller/api/pay/pay_v1_notify_qq_pay.go @@ -0,0 +1,26 @@ +package pay + +import ( + "context" + + v1 "hotgo/api/api/pay/v1" + "hotgo/internal/consts" + "hotgo/internal/model/input/payin" + "hotgo/internal/service" + + "github.com/gogf/gf/v2/frame/g" +) + +func (c *ControllerV1) NotifyQQPay(ctx context.Context, req *v1.NotifyQQPayReq) (res *v1.NotifyQQPayRes, err error) { + if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeQQPay}); err != nil { + return + } + + r := g.RequestFromCtx(ctx) + r.Response.ClearBuffer() + r.Response.Write(``) + r.Response.WriteXml(g.Map{ + "return_code": "SUCCESS", + }) + return +} diff --git a/server/internal/controller/api/pay/pay_v1_notify_wx_pay.go b/server/internal/controller/api/pay/pay_v1_notify_wx_pay.go new file mode 100644 index 0000000..e871910 --- /dev/null +++ b/server/internal/controller/api/pay/pay_v1_notify_wx_pay.go @@ -0,0 +1,22 @@ +package pay + +import ( + "context" + + v1 "hotgo/api/api/pay/v1" + "hotgo/internal/consts" + "hotgo/internal/library/response" + "hotgo/internal/model/input/payin" + "hotgo/internal/service" + + "github.com/gogf/gf/v2/frame/g" +) + +func (c *ControllerV1) NotifyWxPay(ctx context.Context, req *v1.NotifyWxPayReq) (res *v1.NotifyWxPayRes, err error) { + if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeWxPay}); err != nil { + return + } + + response.CustomJson(g.RequestFromCtx(ctx), `{"code": "SUCCESS","message": "收单成功"}`) + return +} diff --git a/server/internal/controller/home/base/site.go b/server/internal/controller/home/base/site.go new file mode 100644 index 0000000..b65ad40 --- /dev/null +++ b/server/internal/controller/home/base/site.go @@ -0,0 +1,38 @@ +// Package base +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package base + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "hotgo/api/home/base" + "hotgo/internal/consts" + "hotgo/internal/model" + "hotgo/internal/service" + "hotgo/utility/simple" +) + +// Site 基础 +var Site = cSite{} + +type cSite struct{} + +func (a *cSite) Index(ctx context.Context, _ *base.SiteIndexReq) (res *base.SiteIndexRes, err error) { + service.View().Render(ctx, model.View{Data: g.Map{ + "name": simple.AppName(ctx), + "version": consts.VersionApp, + }}) + + // err = gerror.New("这是一个测试错误") + // return + + // err = gerror.NewCode(gcode.New(10000, "这是一个测试自定义错误码错误", nil)) + // return + + // service.View().Error(ctx, gerror.New("这是一个允许被自定义格式的错误,默认和通用错误格式一致,你可以修改它")) + // return + return +} diff --git a/server/internal/controller/websocket/handler/admin/monitor.go b/server/internal/controller/websocket/handler/admin/monitor.go new file mode 100644 index 0000000..f10ed93 --- /dev/null +++ b/server/internal/controller/websocket/handler/admin/monitor.go @@ -0,0 +1,198 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "fmt" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/util/gconv" + "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v3/disk" + "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v3/process" + "hotgo/internal/consts" + "hotgo/internal/model" + "hotgo/internal/service" + "hotgo/internal/websocket" + "hotgo/utility/file" + "hotgo/utility/format" + "hotgo/utility/simple" + "os" + "runtime" + "time" +) + +var ( + Monitor = cMonitor{} +) + +type cMonitor struct{} + +type MonitorHeadExtra struct { + Data interface{} `json:"data"` + Data1 string `json:"data1,omitempty"` +} +type MonitorHead struct { + Title string `json:"title"` + Data string `json:"data"` + BottomTitle string `json:"bottomTitle"` + TotalSum string `json:"totalSum"` + IconClass string `json:"iconClass"` + Extra MonitorHeadExtra `json:"extra"` +} + +// RunInfo 运行信息 +func (c *cMonitor) RunInfo(client *websocket.Client, req *websocket.WRequest) { + var ( + meta = service.AdminMonitor().GetMeta(client.Context()) + mHost, _ = host.Info() + pwd, _ = os.Getwd() + gm runtime.MemStats + ) + + runtime.ReadMemStats(&gm) + + data := g.Map{ + // 服务器信息 + "hostname": mHost.Hostname, + "os": mHost.OS, + "arch": mHost.KernelArch, + "intranet_ip": meta.IntranetIP, + "public_ip": meta.PublicIP, + + // 运行信息 + "version": runtime.Version(), // GO 版本 + "hgVersion": consts.VersionApp, // HG 版本 + "startTime": gtime.New(meta.STartTime), + "runTime": gtime.Now().Timestamp() - meta.STartTime, + "rootPath": runtime.GOROOT(), + "pwd": pwd, + "goroutine": runtime.NumGoroutine(), + "goMem": format.FileSize(int64(gm.Sys)), + "goSize": file.DirSize(pwd), + } + + if simple.IsDemo(client.Context()) { + data["rootPath"] = consts.DemoTips + data["pwd"] = consts.DemoTips + data["intranet_ip"] = consts.DemoTips + data["public_ip"] = consts.DemoTips + } + + websocket.SendSuccess(client, req.Event, data) +} + +// Trends 实时数据 +func (c *cMonitor) Trends(client *websocket.Client, req *websocket.WRequest) { + type NetC struct { + Time *gtime.Time `json:"time"` + BytesSent string `json:"bytesSent"` // number of bytes sent + BytesRecv string `json:"bytesRecv"` // number of bytes received + Down float64 `json:"down"` + UP float64 `json:"up"` + } + + var ( + mCpu, cpuErr = cpu.Info() + mCpuUsed float64 + mMem, memErr = mem.VirtualMemory() + mMemUsed float64 + mDisk, diskErr = disk.Usage("/") + mProcess, processErr = process.Pids() + mLoadAvg = new(model.LoadAvgStats) + monitorHeads []MonitorHead + nets []NetC + meta = service.AdminMonitor().GetMeta(client.Context()) + ) + + if cpuErr != nil { + g.Log().Infof(client.Context(), "read CPU info fail:%+v", cpuErr) + mCpu = []cpu.InfoStat{{VendorID: "", ModelName: ""}} + } + + if memErr != nil { + g.Log().Infof(client.Context(), "read mem info fail:%+v", memErr) + mMem = new(mem.VirtualMemoryStat) + } + + if diskErr != nil { + g.Log().Infof(client.Context(), "read disk info fail:%+v", diskErr) + mDisk = new(disk.UsageStat) + } + + if processErr != nil { + g.Log().Infof(client.Context(), "read process.Pids fail:%+v", processErr) + } + + // cpu使用率 + cu, err := cpu.Percent(time.Second, false) + if err == nil { + mCpuUsed = gconv.Float64(fmt.Sprintf("%.2f", cu[0])) + } + + // 内存使用率 + mMemUsed = gconv.Float64(fmt.Sprintf("%.2f", mMem.UsedPercent)) + + // 负载 + if len(meta.LoadAvg) > 0 { + mLoadAvg = meta.LoadAvg[len(meta.LoadAvg)-1] + } + + monitorHeads = append(monitorHeads, MonitorHead{ + Title: "CPU", + Data: "使用率 " + format.Round2String(mCpuUsed) + "%", + BottomTitle: "CPU数量", + TotalSum: gconv.String(runtime.NumCPU()) + "核心", + IconClass: "HardwareChip", + Extra: MonitorHeadExtra{ + Data: mCpu[0].VendorID, + Data1: mCpu[0].ModelName, + }}, + MonitorHead{ + Title: "内存", + Data: "使用率 " + format.Round2String(mMemUsed) + "%", + BottomTitle: "总内存", + TotalSum: format.FileSize(int64(mMem.Total)), + IconClass: "AppsSharp", + Extra: MonitorHeadExtra{ + Data: format.FileSize(int64(mMem.Used)), + Data1: format.FileSize(int64(mMem.Total - mMem.Used)), + }}, + MonitorHead{ + Title: "磁盘", + Data: "已用 " + format.FileSize(int64(mDisk.Used)), + BottomTitle: "总容量", + TotalSum: format.FileSize(int64(mDisk.Total)), + IconClass: "PieChart", + Extra: MonitorHeadExtra{ + Data: format.Round2String(mDisk.UsedPercent), + }}, + MonitorHead{ + Title: "负载", + Data: format.Round2String(mLoadAvg.Ratio) + "%", + BottomTitle: "总进程数", + TotalSum: gconv.String(len(mProcess)) + "个", + IconClass: "Analytics", + }) + + for _, v := range meta.NetIO { + nets = append(nets, NetC{ + Time: v.Time, + BytesSent: format.FileSize(int64(v.BytesSent)), // 转换为最大整数单位 + BytesRecv: format.FileSize(int64(v.BytesRecv)), + Down: format.Round2Float64(v.Down / 1024), // 转换为kb + UP: format.Round2Float64(v.UP / 1024), + }) + } + + websocket.SendSuccess(client, req.Event, g.Map{ + "head": monitorHeads, + "load": meta.LoadAvg, + "net": nets, + }) +} diff --git a/server/internal/controller/websocket/handler/common/site.go b/server/internal/controller/websocket/handler/common/site.go new file mode 100644 index 0000000..400165e --- /dev/null +++ b/server/internal/controller/websocket/handler/common/site.go @@ -0,0 +1,39 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "github.com/gogf/gf/v2/util/gconv" + "hotgo/internal/websocket" +) + +var ( + Site = cSite{} +) + +type cSite struct{} + +func (c *cSite) Join(client *websocket.Client, req *websocket.WRequest) { + name := gconv.String(req.Data["id"]) + + if !client.Tags.Contains(name) { + client.Tags.Append(name) + } + + websocket.SendSuccess(client, req.Event, client.Tags.Slice()) +} + +func (c *cSite) Quit(client *websocket.Client, req *websocket.WRequest) { + name := gconv.String(req.Data["id"]) + if client.Tags.Contains(name) { + client.Tags.RemoveValue(name) + } + websocket.SendSuccess(client, req.Event, client.Tags.Slice()) +} + +func (c *cSite) Ping(client *websocket.Client, req *websocket.WRequest) { + websocket.SendSuccess(client, req.Event) +} diff --git a/server/internal/controller/websocket/send.go b/server/internal/controller/websocket/send.go new file mode 100644 index 0000000..03cec08 --- /dev/null +++ b/server/internal/controller/websocket/send.go @@ -0,0 +1,29 @@ +// Package websocket +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package websocket + +import ( + "context" + "hotgo/api/websocket/base" + "hotgo/internal/websocket" + "hotgo/utility/simple" +) + +// Send 通过http发送ws消息 +var Send = send{} + +type send struct{} + +// SendToTag 发送标签消息 +func (c *send) SendToTag(ctx context.Context, req *base.SendToTagReq) (res *base.SendToTagRes, err error) { + simple.SafeGo(ctx, func(ctx context.Context) { + websocket.SendToTag(req.Tag, &websocket.WResponse{ + Event: req.Response.Event, + Data: req.Response, + }) + }) + return +} diff --git a/server/internal/crons/close_order.go b/server/internal/crons/close_order.go new file mode 100644 index 0000000..8dfebe6 --- /dev/null +++ b/server/internal/crons/close_order.go @@ -0,0 +1,45 @@ +// Package crons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package crons + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" + "hotgo/internal/consts" + "hotgo/internal/dao" + "hotgo/internal/library/cron" + "hotgo/internal/service" +) + +func init() { + cron.Register(CloseOrder) +} + +// CloseOrder 取消过期订单 +var CloseOrder = &cCloseOrder{name: "close_order"} + +type cCloseOrder struct { + name string +} + +func (c *cCloseOrder) GetName() string { + return c.name +} + +// Execute 执行任务 +func (c *cCloseOrder) Execute(ctx context.Context, parser *cron.Parser) (err error) { + _, err = service.AdminOrder().Model(ctx). + Where(dao.AdminOrder.Columns().Status, consts.OrderStatusNotPay). + WhereLTE(dao.AdminOrder.Columns().CreatedAt, gtime.Now().AddDate(0, 0, -1)). + Data(g.Map{ + dao.AdminOrder.Columns().Status: consts.OrderStatusClose, + }).Update() + if err != nil { + parser.Logger.Warning(ctx, "cron CloseOrder Execute err:%+v", err) + } + return +} diff --git a/server/internal/crons/test.go b/server/internal/crons/test.go new file mode 100644 index 0000000..c207c23 --- /dev/null +++ b/server/internal/crons/test.go @@ -0,0 +1,33 @@ +// Package crons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package crons + +import ( + "context" + "hotgo/internal/library/cron" + "time" +) + +func init() { + cron.Register(Test) +} + +// Test 测试任务(无参数) +var Test = &cTest{name: "test"} + +type cTest struct { + name string +} + +func (c *cTest) GetName() string { + return c.name +} + +// Execute 执行任务 +func (c *cTest) Execute(ctx context.Context, parser *cron.Parser) (err error) { + parser.Logger.Infof(ctx, "cron test Execute:%v", time.Now()) + return +} diff --git a/server/internal/crons/test2.go b/server/internal/crons/test2.go new file mode 100644 index 0000000..c312e13 --- /dev/null +++ b/server/internal/crons/test2.go @@ -0,0 +1,45 @@ +// Package crons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package crons + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "hotgo/internal/library/cron" + "time" +) + +func init() { + cron.Register(Test2) +} + +// Test2 测试2任务(带参数) +var Test2 = &cTest2{name: "test2"} + +type cTest2 struct { + name string +} + +func (c *cTest2) GetName() string { + return c.name +} + +// Execute 执行任务 +func (c *cTest2) Execute(ctx context.Context, parser *cron.Parser) (err error) { + if len(parser.Args) != 3 { + err = gerror.New("传入参数不正确!") + return + } + + var ( + name = parser.Args[0] + age = parser.Args[1] + msg = parser.Args[2] + ) + + parser.Logger.Infof(ctx, "cron test2 Execute:%v, name:%v, age:%v, msg:%v", time.Now(), name, age, msg) + return +} diff --git a/server/internal/dao/.gitkeep b/server/internal/dao/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/server/internal/dao/addon_hgexample_table.go b/server/internal/dao/addon_hgexample_table.go new file mode 100755 index 0000000..1191340 --- /dev/null +++ b/server/internal/dao/addon_hgexample_table.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// addonHgexampleTableDao is the data access object for the table hg_addon_hgexample_table. +// You can define custom methods on it to extend its functionality as needed. +type addonHgexampleTableDao struct { + *internal.AddonHgexampleTableDao +} + +var ( + // AddonHgexampleTable is a globally accessible object for table hg_addon_hgexample_table operations. + AddonHgexampleTable = addonHgexampleTableDao{internal.NewAddonHgexampleTableDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/addon_hgexample_tenant_order.go b/server/internal/dao/addon_hgexample_tenant_order.go new file mode 100755 index 0000000..d369ac6 --- /dev/null +++ b/server/internal/dao/addon_hgexample_tenant_order.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// addonHgexampleTenantOrderDao is the data access object for the table hg_addon_hgexample_tenant_order. +// You can define custom methods on it to extend its functionality as needed. +type addonHgexampleTenantOrderDao struct { + *internal.AddonHgexampleTenantOrderDao +} + +var ( + // AddonHgexampleTenantOrder is a globally accessible object for table hg_addon_hgexample_tenant_order operations. + AddonHgexampleTenantOrder = addonHgexampleTenantOrderDao{internal.NewAddonHgexampleTenantOrderDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_cash.go b/server/internal/dao/admin_cash.go new file mode 100755 index 0000000..6bda8cf --- /dev/null +++ b/server/internal/dao/admin_cash.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminCashDao is the data access object for the table hg_admin_cash. +// You can define custom methods on it to extend its functionality as needed. +type adminCashDao struct { + *internal.AdminCashDao +} + +var ( + // AdminCash is a globally accessible object for table hg_admin_cash operations. + AdminCash = adminCashDao{internal.NewAdminCashDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_credits_log.go b/server/internal/dao/admin_credits_log.go new file mode 100755 index 0000000..b415991 --- /dev/null +++ b/server/internal/dao/admin_credits_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminCreditsLogDao is the data access object for the table hg_admin_credits_log. +// You can define custom methods on it to extend its functionality as needed. +type adminCreditsLogDao struct { + *internal.AdminCreditsLogDao +} + +var ( + // AdminCreditsLog is a globally accessible object for table hg_admin_credits_log operations. + AdminCreditsLog = adminCreditsLogDao{internal.NewAdminCreditsLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_dept.go b/server/internal/dao/admin_dept.go new file mode 100755 index 0000000..4eeced7 --- /dev/null +++ b/server/internal/dao/admin_dept.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminDeptDao is the data access object for the table hg_admin_dept. +// You can define custom methods on it to extend its functionality as needed. +type adminDeptDao struct { + *internal.AdminDeptDao +} + +var ( + // AdminDept is a globally accessible object for table hg_admin_dept operations. + AdminDept = adminDeptDao{internal.NewAdminDeptDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_member.go b/server/internal/dao/admin_member.go new file mode 100755 index 0000000..112f3f0 --- /dev/null +++ b/server/internal/dao/admin_member.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminMemberDao is the data access object for the table hg_admin_member. +// You can define custom methods on it to extend its functionality as needed. +type adminMemberDao struct { + *internal.AdminMemberDao +} + +var ( + // AdminMember is a globally accessible object for table hg_admin_member operations. + AdminMember = adminMemberDao{internal.NewAdminMemberDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_member_post.go b/server/internal/dao/admin_member_post.go new file mode 100755 index 0000000..1c4ab68 --- /dev/null +++ b/server/internal/dao/admin_member_post.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminMemberPostDao is the data access object for the table hg_admin_member_post. +// You can define custom methods on it to extend its functionality as needed. +type adminMemberPostDao struct { + *internal.AdminMemberPostDao +} + +var ( + // AdminMemberPost is a globally accessible object for table hg_admin_member_post operations. + AdminMemberPost = adminMemberPostDao{internal.NewAdminMemberPostDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_member_role.go b/server/internal/dao/admin_member_role.go new file mode 100755 index 0000000..7b48a86 --- /dev/null +++ b/server/internal/dao/admin_member_role.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminMemberRoleDao is the data access object for the table hg_admin_member_role. +// You can define custom methods on it to extend its functionality as needed. +type adminMemberRoleDao struct { + *internal.AdminMemberRoleDao +} + +var ( + // AdminMemberRole is a globally accessible object for table hg_admin_member_role operations. + AdminMemberRole = adminMemberRoleDao{internal.NewAdminMemberRoleDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_menu.go b/server/internal/dao/admin_menu.go new file mode 100755 index 0000000..8bac378 --- /dev/null +++ b/server/internal/dao/admin_menu.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminMenuDao is the data access object for the table hg_admin_menu. +// You can define custom methods on it to extend its functionality as needed. +type adminMenuDao struct { + *internal.AdminMenuDao +} + +var ( + // AdminMenu is a globally accessible object for table hg_admin_menu operations. + AdminMenu = adminMenuDao{internal.NewAdminMenuDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_notice.go b/server/internal/dao/admin_notice.go new file mode 100755 index 0000000..457c3e7 --- /dev/null +++ b/server/internal/dao/admin_notice.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminNoticeDao is the data access object for the table hg_admin_notice. +// You can define custom methods on it to extend its functionality as needed. +type adminNoticeDao struct { + *internal.AdminNoticeDao +} + +var ( + // AdminNotice is a globally accessible object for table hg_admin_notice operations. + AdminNotice = adminNoticeDao{internal.NewAdminNoticeDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_notice_read.go b/server/internal/dao/admin_notice_read.go new file mode 100755 index 0000000..1a8f484 --- /dev/null +++ b/server/internal/dao/admin_notice_read.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminNoticeReadDao is the data access object for the table hg_admin_notice_read. +// You can define custom methods on it to extend its functionality as needed. +type adminNoticeReadDao struct { + *internal.AdminNoticeReadDao +} + +var ( + // AdminNoticeRead is a globally accessible object for table hg_admin_notice_read operations. + AdminNoticeRead = adminNoticeReadDao{internal.NewAdminNoticeReadDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_oauth.go b/server/internal/dao/admin_oauth.go new file mode 100755 index 0000000..eed3b14 --- /dev/null +++ b/server/internal/dao/admin_oauth.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminOauthDao is the data access object for the table hg_admin_oauth. +// You can define custom methods on it to extend its functionality as needed. +type adminOauthDao struct { + *internal.AdminOauthDao +} + +var ( + // AdminOauth is a globally accessible object for table hg_admin_oauth operations. + AdminOauth = adminOauthDao{internal.NewAdminOauthDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_order.go b/server/internal/dao/admin_order.go new file mode 100755 index 0000000..8fd4a80 --- /dev/null +++ b/server/internal/dao/admin_order.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminOrderDao is the data access object for the table hg_admin_order. +// You can define custom methods on it to extend its functionality as needed. +type adminOrderDao struct { + *internal.AdminOrderDao +} + +var ( + // AdminOrder is a globally accessible object for table hg_admin_order operations. + AdminOrder = adminOrderDao{internal.NewAdminOrderDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_post.go b/server/internal/dao/admin_post.go new file mode 100755 index 0000000..ecf69cd --- /dev/null +++ b/server/internal/dao/admin_post.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminPostDao is the data access object for the table hg_admin_post. +// You can define custom methods on it to extend its functionality as needed. +type adminPostDao struct { + *internal.AdminPostDao +} + +var ( + // AdminPost is a globally accessible object for table hg_admin_post operations. + AdminPost = adminPostDao{internal.NewAdminPostDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_role.go b/server/internal/dao/admin_role.go new file mode 100755 index 0000000..8315e43 --- /dev/null +++ b/server/internal/dao/admin_role.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminRoleDao is the data access object for the table hg_admin_role. +// You can define custom methods on it to extend its functionality as needed. +type adminRoleDao struct { + *internal.AdminRoleDao +} + +var ( + // AdminRole is a globally accessible object for table hg_admin_role operations. + AdminRole = adminRoleDao{internal.NewAdminRoleDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_role_casbin.go b/server/internal/dao/admin_role_casbin.go new file mode 100755 index 0000000..3557470 --- /dev/null +++ b/server/internal/dao/admin_role_casbin.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminRoleCasbinDao is the data access object for the table hg_admin_role_casbin. +// You can define custom methods on it to extend its functionality as needed. +type adminRoleCasbinDao struct { + *internal.AdminRoleCasbinDao +} + +var ( + // AdminRoleCasbin is a globally accessible object for table hg_admin_role_casbin operations. + AdminRoleCasbin = adminRoleCasbinDao{internal.NewAdminRoleCasbinDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/admin_role_menu.go b/server/internal/dao/admin_role_menu.go new file mode 100755 index 0000000..e180651 --- /dev/null +++ b/server/internal/dao/admin_role_menu.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// adminRoleMenuDao is the data access object for the table hg_admin_role_menu. +// You can define custom methods on it to extend its functionality as needed. +type adminRoleMenuDao struct { + *internal.AdminRoleMenuDao +} + +var ( + // AdminRoleMenu is a globally accessible object for table hg_admin_role_menu operations. + AdminRoleMenu = adminRoleMenuDao{internal.NewAdminRoleMenuDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member.go b/server/internal/dao/app_member.go new file mode 100644 index 0000000..097db43 --- /dev/null +++ b/server/internal/dao/app_member.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberDao is the data access object for the table hg_app_member. +// You can define custom methods on it to extend its functionality as needed. +type appMemberDao struct { + *internal.AppMemberDao +} + +var ( + // AppMember is a globally accessible object for table hg_app_member operations. + AppMember = appMemberDao{internal.NewAppMemberDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member_address.go b/server/internal/dao/app_member_address.go new file mode 100644 index 0000000..6cb21de --- /dev/null +++ b/server/internal/dao/app_member_address.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberAddressDao is the data access object for the table hg_app_member_address. +// You can define custom methods on it to extend its functionality as needed. +type appMemberAddressDao struct { + *internal.AppMemberAddressDao +} + +var ( + // AppMemberAddress is a globally accessible object for table hg_app_member_address operations. + AppMemberAddress = appMemberAddressDao{internal.NewAppMemberAddressDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member_level.go b/server/internal/dao/app_member_level.go new file mode 100644 index 0000000..59bcd04 --- /dev/null +++ b/server/internal/dao/app_member_level.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberLevelDao is the data access object for the table hg_app_member_level. +// You can define custom methods on it to extend its functionality as needed. +type appMemberLevelDao struct { + *internal.AppMemberLevelDao +} + +var ( + // AppMemberLevel is a globally accessible object for table hg_app_member_level operations. + AppMemberLevel = appMemberLevelDao{internal.NewAppMemberLevelDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member_level_version.go b/server/internal/dao/app_member_level_version.go new file mode 100644 index 0000000..947e10e --- /dev/null +++ b/server/internal/dao/app_member_level_version.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberLevelVersionDao is the data access object for the table hg_app_member_level_version. +// You can define custom methods on it to extend its functionality as needed. +type appMemberLevelVersionDao struct { + *internal.AppMemberLevelVersionDao +} + +var ( + // AppMemberLevelVersion is a globally accessible object for table hg_app_member_level_version operations. + AppMemberLevelVersion = appMemberLevelVersionDao{internal.NewAppMemberLevelVersionDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member_notice.go b/server/internal/dao/app_member_notice.go new file mode 100644 index 0000000..731dda9 --- /dev/null +++ b/server/internal/dao/app_member_notice.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberNoticeDao is the data access object for the table hg_app_member_notice. +// You can define custom methods on it to extend its functionality as needed. +type appMemberNoticeDao struct { + *internal.AppMemberNoticeDao +} + +var ( + // AppMemberNotice is a globally accessible object for table hg_app_member_notice operations. + AppMemberNotice = appMemberNoticeDao{internal.NewAppMemberNoticeDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member_payment_account.go b/server/internal/dao/app_member_payment_account.go new file mode 100644 index 0000000..e294a3b --- /dev/null +++ b/server/internal/dao/app_member_payment_account.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberPaymentAccountDao is the data access object for the table hg_app_member_payment_account. +// You can define custom methods on it to extend its functionality as needed. +type appMemberPaymentAccountDao struct { + *internal.AppMemberPaymentAccountDao +} + +var ( + // AppMemberPaymentAccount is a globally accessible object for table hg_app_member_payment_account operations. + AppMemberPaymentAccount = appMemberPaymentAccountDao{internal.NewAppMemberPaymentAccountDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member_profile.go b/server/internal/dao/app_member_profile.go new file mode 100644 index 0000000..e641453 --- /dev/null +++ b/server/internal/dao/app_member_profile.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberProfileDao is the data access object for the table hg_app_member_profile. +// You can define custom methods on it to extend its functionality as needed. +type appMemberProfileDao struct { + *internal.AppMemberProfileDao +} + +var ( + // AppMemberProfile is a globally accessible object for table hg_app_member_profile operations. + AppMemberProfile = appMemberProfileDao{internal.NewAppMemberProfileDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/app_member_status_log.go b/server/internal/dao/app_member_status_log.go new file mode 100644 index 0000000..25d7854 --- /dev/null +++ b/server/internal/dao/app_member_status_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// appMemberStatusLogDao is the data access object for the table hg_app_member_status_log. +// You can define custom methods on it to extend its functionality as needed. +type appMemberStatusLogDao struct { + *internal.AppMemberStatusLogDao +} + +var ( + // AppMemberStatusLog is a globally accessible object for table hg_app_member_status_log operations. + AppMemberStatusLog = appMemberStatusLogDao{internal.NewAppMemberStatusLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/approval_action.go b/server/internal/dao/approval_action.go new file mode 100644 index 0000000..e0e0c42 --- /dev/null +++ b/server/internal/dao/approval_action.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// approvalActionDao is the data access object for the table hg_approval_action. +// You can define custom methods on it to extend its functionality as needed. +type approvalActionDao struct { + *internal.ApprovalActionDao +} + +var ( + // ApprovalAction is a globally accessible object for table hg_approval_action operations. + ApprovalAction = approvalActionDao{internal.NewApprovalActionDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/approval_request.go b/server/internal/dao/approval_request.go new file mode 100644 index 0000000..007ce73 --- /dev/null +++ b/server/internal/dao/approval_request.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// approvalRequestDao is the data access object for the table hg_approval_request. +// You can define custom methods on it to extend its functionality as needed. +type approvalRequestDao struct { + *internal.ApprovalRequestDao +} + +var ( + // ApprovalRequest is a globally accessible object for table hg_approval_request operations. + ApprovalRequest = approvalRequestDao{internal.NewApprovalRequestDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/banner.go b/server/internal/dao/banner.go new file mode 100644 index 0000000..7dee7cc --- /dev/null +++ b/server/internal/dao/banner.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// bannerDao is the data access object for the table hg_banner. +// You can define custom methods on it to extend its functionality as needed. +type bannerDao struct { + *internal.BannerDao +} + +var ( + // Banner is a globally accessible object for table hg_banner operations. + Banner = bannerDao{internal.NewBannerDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/biz_audit_log.go b/server/internal/dao/biz_audit_log.go new file mode 100644 index 0000000..cf33461 --- /dev/null +++ b/server/internal/dao/biz_audit_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// bizAuditLogDao is the data access object for the table hg_biz_audit_log. +// You can define custom methods on it to extend its functionality as needed. +type bizAuditLogDao struct { + *internal.BizAuditLogDao +} + +var ( + // BizAuditLog is a globally accessible object for table hg_biz_audit_log operations. + BizAuditLog = bizAuditLogDao{internal.NewBizAuditLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/content.go b/server/internal/dao/content.go new file mode 100644 index 0000000..c619866 --- /dev/null +++ b/server/internal/dao/content.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// contentDao is the data access object for the table hg_content. +// You can define custom methods on it to extend its functionality as needed. +type contentDao struct { + *internal.ContentDao +} + +var ( + // Content is a globally accessible object for table hg_content operations. + Content = contentDao{internal.NewContentDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/content_version.go b/server/internal/dao/content_version.go new file mode 100644 index 0000000..0a95d87 --- /dev/null +++ b/server/internal/dao/content_version.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// contentVersionDao is the data access object for the table hg_content_version. +// You can define custom methods on it to extend its functionality as needed. +type contentVersionDao struct { + *internal.ContentVersionDao +} + +var ( + // ContentVersion is a globally accessible object for table hg_content_version operations. + ContentVersion = contentVersionDao{internal.NewContentVersionDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/customer_service.go b/server/internal/dao/customer_service.go new file mode 100644 index 0000000..f016e2c --- /dev/null +++ b/server/internal/dao/customer_service.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// customerServiceDao is the data access object for the table hg_customer_service. +// You can define custom methods on it to extend its functionality as needed. +type customerServiceDao struct { + *internal.CustomerServiceDao +} + +var ( + // CustomerService is a globally accessible object for table hg_customer_service operations. + CustomerService = customerServiceDao{internal.NewCustomerServiceDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/dashboard_daily_stat.go b/server/internal/dao/dashboard_daily_stat.go new file mode 100644 index 0000000..2850475 --- /dev/null +++ b/server/internal/dao/dashboard_daily_stat.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// dashboardDailyStatDao is the data access object for the table hg_dashboard_daily_stat. +// You can define custom methods on it to extend its functionality as needed. +type dashboardDailyStatDao struct { + *internal.DashboardDailyStatDao +} + +var ( + // DashboardDailyStat is a globally accessible object for table hg_dashboard_daily_stat operations. + DashboardDailyStat = dashboardDailyStatDao{internal.NewDashboardDailyStatDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/finance_review.go b/server/internal/dao/finance_review.go new file mode 100644 index 0000000..a4b70c6 --- /dev/null +++ b/server/internal/dao/finance_review.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// financeReviewDao is the data access object for the table hg_finance_review. +// You can define custom methods on it to extend its functionality as needed. +type financeReviewDao struct { + *internal.FinanceReviewDao +} + +var ( + // FinanceReview is a globally accessible object for table hg_finance_review operations. + FinanceReview = financeReviewDao{internal.NewFinanceReviewDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/idempotency_record.go b/server/internal/dao/idempotency_record.go new file mode 100644 index 0000000..56dbe87 --- /dev/null +++ b/server/internal/dao/idempotency_record.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// idempotencyRecordDao is the data access object for the table hg_idempotency_record. +// You can define custom methods on it to extend its functionality as needed. +type idempotencyRecordDao struct { + *internal.IdempotencyRecordDao +} + +var ( + // IdempotencyRecord is a globally accessible object for table hg_idempotency_record operations. + IdempotencyRecord = idempotencyRecordDao{internal.NewIdempotencyRecordDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/internal/addon_hgexample_table.go b/server/internal/dao/internal/addon_hgexample_table.go new file mode 100755 index 0000000..97a8551 --- /dev/null +++ b/server/internal/dao/internal/addon_hgexample_table.go @@ -0,0 +1,151 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AddonHgexampleTableDao is the data access object for the table hg_addon_hgexample_table. +type AddonHgexampleTableDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AddonHgexampleTableColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AddonHgexampleTableColumns defines and stores column names for the table hg_addon_hgexample_table. +type AddonHgexampleTableColumns struct { + Id string // ID + Pid string // 上级ID + Level string // 树等级 + Tree string // 关系树 + CategoryId string // 分类ID + Flag string // 标签 + Title string // 标题 + Description string // 描述 + Content string // 内容 + Image string // 单图 + Images string // 多图 + Attachfile string // 附件 + Attachfiles string // 多附件 + Map string // 动态键值对 + Star string // 推荐星 + Price string // 价格 + Views string // 浏览次数 + ActivityAt string // 活动时间 + StartAt string // 开启时间 + EndAt string // 结束时间 + Switch string // 开关 + Sort string // 排序 + Avatar string // 头像 + Sex string // 性别 + Qq string // qq + Email string // 邮箱 + Mobile string // 手机号码 + Hobby string // 爱好 + Channel string // 渠道 + CityId string // 所在城市 + Remark string // 备注 + Status string // 状态 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 + DeletedAt string // 删除时间 +} + +// addonHgexampleTableColumns holds the columns for the table hg_addon_hgexample_table. +var addonHgexampleTableColumns = AddonHgexampleTableColumns{ + Id: "id", + Pid: "pid", + Level: "level", + Tree: "tree", + CategoryId: "category_id", + Flag: "flag", + Title: "title", + Description: "description", + Content: "content", + Image: "image", + Images: "images", + Attachfile: "attachfile", + Attachfiles: "attachfiles", + Map: "map", + Star: "star", + Price: "price", + Views: "views", + ActivityAt: "activity_at", + StartAt: "start_at", + EndAt: "end_at", + Switch: "switch", + Sort: "sort", + Avatar: "avatar", + Sex: "sex", + Qq: "qq", + Email: "email", + Mobile: "mobile", + Hobby: "hobby", + Channel: "channel", + CityId: "city_id", + Remark: "remark", + Status: "status", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewAddonHgexampleTableDao creates and returns a new DAO object for table data access. +func NewAddonHgexampleTableDao(handlers ...gdb.ModelHandler) *AddonHgexampleTableDao { + return &AddonHgexampleTableDao{ + group: "default", + table: "hg_addon_hgexample_table", + columns: addonHgexampleTableColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AddonHgexampleTableDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AddonHgexampleTableDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AddonHgexampleTableDao) Columns() AddonHgexampleTableColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AddonHgexampleTableDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AddonHgexampleTableDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AddonHgexampleTableDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/addon_hgexample_tenant_order.go b/server/internal/dao/internal/addon_hgexample_tenant_order.go new file mode 100755 index 0000000..bf41fd8 --- /dev/null +++ b/server/internal/dao/internal/addon_hgexample_tenant_order.go @@ -0,0 +1,99 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AddonHgexampleTenantOrderDao is the data access object for the table hg_addon_hgexample_tenant_order. +type AddonHgexampleTenantOrderDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AddonHgexampleTenantOrderColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AddonHgexampleTenantOrderColumns defines and stores column names for the table hg_addon_hgexample_tenant_order. +type AddonHgexampleTenantOrderColumns struct { + Id string // 主键 + TenantId string // 租户ID + MerchantId string // 商户ID + UserId string // 用户ID + ProductName string // 购买产品 + OrderSn string // 订单号 + Money string // 充值金额 + Remark string // 备注 + Status string // 订单状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// addonHgexampleTenantOrderColumns holds the columns for the table hg_addon_hgexample_tenant_order. +var addonHgexampleTenantOrderColumns = AddonHgexampleTenantOrderColumns{ + Id: "id", + TenantId: "tenant_id", + MerchantId: "merchant_id", + UserId: "user_id", + ProductName: "product_name", + OrderSn: "order_sn", + Money: "money", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAddonHgexampleTenantOrderDao creates and returns a new DAO object for table data access. +func NewAddonHgexampleTenantOrderDao(handlers ...gdb.ModelHandler) *AddonHgexampleTenantOrderDao { + return &AddonHgexampleTenantOrderDao{ + group: "default", + table: "hg_addon_hgexample_tenant_order", + columns: addonHgexampleTenantOrderColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AddonHgexampleTenantOrderDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AddonHgexampleTenantOrderDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AddonHgexampleTenantOrderDao) Columns() AddonHgexampleTenantOrderColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AddonHgexampleTenantOrderDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AddonHgexampleTenantOrderDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AddonHgexampleTenantOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_cash.go b/server/internal/dao/internal/admin_cash.go new file mode 100755 index 0000000..a9bdb1b --- /dev/null +++ b/server/internal/dao/internal/admin_cash.go @@ -0,0 +1,97 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminCashDao is the data access object for the table hg_admin_cash. +type AdminCashDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminCashColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminCashColumns defines and stores column names for the table hg_admin_cash. +type AdminCashColumns struct { + Id string // ID + MemberId string // 管理员ID + Money string // 提现金额 + Fee string // 手续费 + LastMoney string // 最终到账金额 + Ip string // 申请人IP + Status string // 状态码 + Msg string // 处理结果 + HandleAt string // 处理时间 + CreatedAt string // 申请时间 +} + +// adminCashColumns holds the columns for the table hg_admin_cash. +var adminCashColumns = AdminCashColumns{ + Id: "id", + MemberId: "member_id", + Money: "money", + Fee: "fee", + LastMoney: "last_money", + Ip: "ip", + Status: "status", + Msg: "msg", + HandleAt: "handle_at", + CreatedAt: "created_at", +} + +// NewAdminCashDao creates and returns a new DAO object for table data access. +func NewAdminCashDao(handlers ...gdb.ModelHandler) *AdminCashDao { + return &AdminCashDao{ + group: "default", + table: "hg_admin_cash", + columns: adminCashColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminCashDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminCashDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminCashDao) Columns() AdminCashColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminCashDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminCashDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminCashDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_credits_log.go b/server/internal/dao/internal/admin_credits_log.go new file mode 100755 index 0000000..0b3602e --- /dev/null +++ b/server/internal/dao/internal/admin_credits_log.go @@ -0,0 +1,107 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminCreditsLogDao is the data access object for the table hg_admin_credits_log. +type AdminCreditsLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminCreditsLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminCreditsLogColumns defines and stores column names for the table hg_admin_credits_log. +type AdminCreditsLogColumns struct { + Id string // 变动ID + MemberId string // 管理员ID + AppId string // 应用id + AddonsName string // 插件名称 + CreditType string // 变动类型 + CreditGroup string // 变动组别 + BeforeNum string // 变动前 + Num string // 变动数据 + AfterNum string // 变动后 + Remark string // 备注 + Ip string // 操作人IP + MapId string // 关联ID + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// adminCreditsLogColumns holds the columns for the table hg_admin_credits_log. +var adminCreditsLogColumns = AdminCreditsLogColumns{ + Id: "id", + MemberId: "member_id", + AppId: "app_id", + AddonsName: "addons_name", + CreditType: "credit_type", + CreditGroup: "credit_group", + BeforeNum: "before_num", + Num: "num", + AfterNum: "after_num", + Remark: "remark", + Ip: "ip", + MapId: "map_id", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAdminCreditsLogDao creates and returns a new DAO object for table data access. +func NewAdminCreditsLogDao(handlers ...gdb.ModelHandler) *AdminCreditsLogDao { + return &AdminCreditsLogDao{ + group: "default", + table: "hg_admin_credits_log", + columns: adminCreditsLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminCreditsLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminCreditsLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminCreditsLogDao) Columns() AdminCreditsLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminCreditsLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminCreditsLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminCreditsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_dept.go b/server/internal/dao/internal/admin_dept.go new file mode 100755 index 0000000..becb639 --- /dev/null +++ b/server/internal/dao/internal/admin_dept.go @@ -0,0 +1,105 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminDeptDao is the data access object for the table hg_admin_dept. +type AdminDeptDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminDeptColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminDeptColumns defines and stores column names for the table hg_admin_dept. +type AdminDeptColumns struct { + Id string // 部门ID + Pid string // 父部门ID + Name string // 部门名称 + Code string // 部门编码 + Type string // 部门类型 + Leader string // 负责人 + Phone string // 联系电话 + Email string // 邮箱 + Level string // 关系树等级 + Tree string // 关系树 + Sort string // 排序 + Status string // 部门状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// adminDeptColumns holds the columns for the table hg_admin_dept. +var adminDeptColumns = AdminDeptColumns{ + Id: "id", + Pid: "pid", + Name: "name", + Code: "code", + Type: "type", + Leader: "leader", + Phone: "phone", + Email: "email", + Level: "level", + Tree: "tree", + Sort: "sort", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAdminDeptDao creates and returns a new DAO object for table data access. +func NewAdminDeptDao(handlers ...gdb.ModelHandler) *AdminDeptDao { + return &AdminDeptDao{ + group: "default", + table: "hg_admin_dept", + columns: adminDeptColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminDeptDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminDeptDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminDeptDao) Columns() AdminDeptColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminDeptDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminDeptDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminDeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_member.go b/server/internal/dao/internal/admin_member.go new file mode 100755 index 0000000..93ebaa7 --- /dev/null +++ b/server/internal/dao/internal/admin_member.go @@ -0,0 +1,133 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminMemberDao is the data access object for the table hg_admin_member. +type AdminMemberDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminMemberColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminMemberColumns defines and stores column names for the table hg_admin_member. +type AdminMemberColumns struct { + Id string // 管理员ID + DeptId string // 部门ID + RoleId string // 角色ID + RealName string // 真实姓名 + Username string // 帐号 + PasswordHash string // 密码 + Salt string // 密码盐 + PasswordResetToken string // 密码重置令牌 + Integral string // 积分 + Balance string // 余额 + Avatar string // 头像 + Sex string // 性别 + Qq string // qq + Email string // 邮箱 + Mobile string // 手机号码 + Birthday string // 生日 + CityId string // 城市编码 + Address string // 联系地址 + Pid string // 上级管理员ID + Level string // 关系树等级 + Tree string // 关系树 + InviteCode string // 邀请码 + Cash string // 提现配置 + LastActiveAt string // 最后活跃时间 + Remark string // 备注 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// adminMemberColumns holds the columns for the table hg_admin_member. +var adminMemberColumns = AdminMemberColumns{ + Id: "id", + DeptId: "dept_id", + RoleId: "role_id", + RealName: "real_name", + Username: "username", + PasswordHash: "password_hash", + Salt: "salt", + PasswordResetToken: "password_reset_token", + Integral: "integral", + Balance: "balance", + Avatar: "avatar", + Sex: "sex", + Qq: "qq", + Email: "email", + Mobile: "mobile", + Birthday: "birthday", + CityId: "city_id", + Address: "address", + Pid: "pid", + Level: "level", + Tree: "tree", + InviteCode: "invite_code", + Cash: "cash", + LastActiveAt: "last_active_at", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAdminMemberDao creates and returns a new DAO object for table data access. +func NewAdminMemberDao(handlers ...gdb.ModelHandler) *AdminMemberDao { + return &AdminMemberDao{ + group: "default", + table: "hg_admin_member", + columns: adminMemberColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminMemberDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminMemberDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminMemberDao) Columns() AdminMemberColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminMemberDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminMemberDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminMemberDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_member_post.go b/server/internal/dao/internal/admin_member_post.go new file mode 100755 index 0000000..8a30c9e --- /dev/null +++ b/server/internal/dao/internal/admin_member_post.go @@ -0,0 +1,81 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminMemberPostDao is the data access object for the table hg_admin_member_post. +type AdminMemberPostDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminMemberPostColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminMemberPostColumns defines and stores column names for the table hg_admin_member_post. +type AdminMemberPostColumns struct { + MemberId string // 管理员ID + PostId string // 岗位ID +} + +// adminMemberPostColumns holds the columns for the table hg_admin_member_post. +var adminMemberPostColumns = AdminMemberPostColumns{ + MemberId: "member_id", + PostId: "post_id", +} + +// NewAdminMemberPostDao creates and returns a new DAO object for table data access. +func NewAdminMemberPostDao(handlers ...gdb.ModelHandler) *AdminMemberPostDao { + return &AdminMemberPostDao{ + group: "default", + table: "hg_admin_member_post", + columns: adminMemberPostColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminMemberPostDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminMemberPostDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminMemberPostDao) Columns() AdminMemberPostColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminMemberPostDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminMemberPostDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminMemberPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_member_role.go b/server/internal/dao/internal/admin_member_role.go new file mode 100755 index 0000000..094d663 --- /dev/null +++ b/server/internal/dao/internal/admin_member_role.go @@ -0,0 +1,81 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminMemberRoleDao is the data access object for the table hg_admin_member_role. +type AdminMemberRoleDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminMemberRoleColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminMemberRoleColumns defines and stores column names for the table hg_admin_member_role. +type AdminMemberRoleColumns struct { + MemberId string // 管理员ID + RoleId string // 角色ID +} + +// adminMemberRoleColumns holds the columns for the table hg_admin_member_role. +var adminMemberRoleColumns = AdminMemberRoleColumns{ + MemberId: "member_id", + RoleId: "role_id", +} + +// NewAdminMemberRoleDao creates and returns a new DAO object for table data access. +func NewAdminMemberRoleDao(handlers ...gdb.ModelHandler) *AdminMemberRoleDao { + return &AdminMemberRoleDao{ + group: "default", + table: "hg_admin_member_role", + columns: adminMemberRoleColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminMemberRoleDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminMemberRoleDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminMemberRoleDao) Columns() AdminMemberRoleColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminMemberRoleDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminMemberRoleDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminMemberRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_menu.go b/server/internal/dao/internal/admin_menu.go new file mode 100755 index 0000000..3312718 --- /dev/null +++ b/server/internal/dao/internal/admin_menu.go @@ -0,0 +1,129 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminMenuDao is the data access object for the table hg_admin_menu. +type AdminMenuDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminMenuColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminMenuColumns defines and stores column names for the table hg_admin_menu. +type AdminMenuColumns struct { + Id string // 菜单ID + Pid string // 父菜单ID + Level string // 关系树等级 + Tree string // 关系树 + Title string // 菜单名称 + Name string // 名称编码 + Path string // 路由地址 + Icon string // 菜单图标 + Type string // 菜单类型(1目录 2菜单 3按钮) + Redirect string // 重定向地址 + Permissions string // 菜单包含权限集合 + PermissionName string // 权限名称 + Component string // 组件路径 + AlwaysShow string // 取消自动计算根路由模式 + ActiveMenu string // 高亮菜单编码 + IsRoot string // 是否跟路由 + IsFrame string // 是否内嵌 + FrameSrc string // 内联外部地址 + KeepAlive string // 缓存该路由 + Hidden string // 是否隐藏 + Affix string // 是否固定 + Sort string // 排序 + Remark string // 备注 + Status string // 菜单状态 + UpdatedAt string // 更新时间 + CreatedAt string // 创建时间 +} + +// adminMenuColumns holds the columns for the table hg_admin_menu. +var adminMenuColumns = AdminMenuColumns{ + Id: "id", + Pid: "pid", + Level: "level", + Tree: "tree", + Title: "title", + Name: "name", + Path: "path", + Icon: "icon", + Type: "type", + Redirect: "redirect", + Permissions: "permissions", + PermissionName: "permission_name", + Component: "component", + AlwaysShow: "always_show", + ActiveMenu: "active_menu", + IsRoot: "is_root", + IsFrame: "is_frame", + FrameSrc: "frame_src", + KeepAlive: "keep_alive", + Hidden: "hidden", + Affix: "affix", + Sort: "sort", + Remark: "remark", + Status: "status", + UpdatedAt: "updated_at", + CreatedAt: "created_at", +} + +// NewAdminMenuDao creates and returns a new DAO object for table data access. +func NewAdminMenuDao(handlers ...gdb.ModelHandler) *AdminMenuDao { + return &AdminMenuDao{ + group: "default", + table: "hg_admin_menu", + columns: adminMenuColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminMenuDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminMenuDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminMenuDao) Columns() AdminMenuColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminMenuDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminMenuDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_notice.go b/server/internal/dao/internal/admin_notice.go new file mode 100755 index 0000000..ecb0cb9 --- /dev/null +++ b/server/internal/dao/internal/admin_notice.go @@ -0,0 +1,105 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminNoticeDao is the data access object for the table hg_admin_notice. +type AdminNoticeDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminNoticeColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminNoticeColumns defines and stores column names for the table hg_admin_notice. +type AdminNoticeColumns struct { + Id string // 公告ID + Title string // 公告标题 + Type string // 公告类型 + Tag string // 标签 + Content string // 公告内容 + Receiver string // 接收者 + Remark string // 备注 + Sort string // 排序 + Status string // 公告状态 + CreatedBy string // 发送人 + UpdatedBy string // 修改人 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// adminNoticeColumns holds the columns for the table hg_admin_notice. +var adminNoticeColumns = AdminNoticeColumns{ + Id: "id", + Title: "title", + Type: "type", + Tag: "tag", + Content: "content", + Receiver: "receiver", + Remark: "remark", + Sort: "sort", + Status: "status", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewAdminNoticeDao creates and returns a new DAO object for table data access. +func NewAdminNoticeDao(handlers ...gdb.ModelHandler) *AdminNoticeDao { + return &AdminNoticeDao{ + group: "default", + table: "hg_admin_notice", + columns: adminNoticeColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminNoticeDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminNoticeDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminNoticeDao) Columns() AdminNoticeColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminNoticeDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminNoticeDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminNoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_notice_read.go b/server/internal/dao/internal/admin_notice_read.go new file mode 100755 index 0000000..2ee0f7b --- /dev/null +++ b/server/internal/dao/internal/admin_notice_read.go @@ -0,0 +1,89 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminNoticeReadDao is the data access object for the table hg_admin_notice_read. +type AdminNoticeReadDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminNoticeReadColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminNoticeReadColumns defines and stores column names for the table hg_admin_notice_read. +type AdminNoticeReadColumns struct { + Id string // 记录ID + NoticeId string // 公告ID + MemberId string // 会员ID + Clicks string // 已读次数 + UpdatedAt string // 更新时间 + CreatedAt string // 阅读时间 +} + +// adminNoticeReadColumns holds the columns for the table hg_admin_notice_read. +var adminNoticeReadColumns = AdminNoticeReadColumns{ + Id: "id", + NoticeId: "notice_id", + MemberId: "member_id", + Clicks: "clicks", + UpdatedAt: "updated_at", + CreatedAt: "created_at", +} + +// NewAdminNoticeReadDao creates and returns a new DAO object for table data access. +func NewAdminNoticeReadDao(handlers ...gdb.ModelHandler) *AdminNoticeReadDao { + return &AdminNoticeReadDao{ + group: "default", + table: "hg_admin_notice_read", + columns: adminNoticeReadColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminNoticeReadDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminNoticeReadDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminNoticeReadDao) Columns() AdminNoticeReadColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminNoticeReadDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminNoticeReadDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminNoticeReadDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_oauth.go b/server/internal/dao/internal/admin_oauth.go new file mode 100755 index 0000000..f812ac6 --- /dev/null +++ b/server/internal/dao/internal/admin_oauth.go @@ -0,0 +1,107 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminOauthDao is the data access object for the table hg_admin_oauth. +type AdminOauthDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminOauthColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminOauthColumns defines and stores column names for the table hg_admin_oauth. +type AdminOauthColumns struct { + Id string // 主键 + MemberId string // 用户ID + Unionid string // 唯一ID + OauthClient string // 授权组别 + OauthOpenid string // 授权开放ID + Sex string // 性别 + Nickname string // 昵称 + HeadPortrait string // 头像 + Birthday string // 生日 + Country string // 国家 + Province string // 省 + City string // 市 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// adminOauthColumns holds the columns for the table hg_admin_oauth. +var adminOauthColumns = AdminOauthColumns{ + Id: "id", + MemberId: "member_id", + Unionid: "unionid", + OauthClient: "oauth_client", + OauthOpenid: "oauth_openid", + Sex: "sex", + Nickname: "nickname", + HeadPortrait: "head_portrait", + Birthday: "birthday", + Country: "country", + Province: "province", + City: "city", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAdminOauthDao creates and returns a new DAO object for table data access. +func NewAdminOauthDao(handlers ...gdb.ModelHandler) *AdminOauthDao { + return &AdminOauthDao{ + group: "default", + table: "hg_admin_oauth", + columns: adminOauthColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminOauthDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminOauthDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminOauthDao) Columns() AdminOauthColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminOauthDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminOauthDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminOauthDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_order.go b/server/internal/dao/internal/admin_order.go new file mode 100755 index 0000000..8b3df6f --- /dev/null +++ b/server/internal/dao/internal/admin_order.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminOrderDao is the data access object for the table hg_admin_order. +type AdminOrderDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminOrderColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminOrderColumns defines and stores column names for the table hg_admin_order. +type AdminOrderColumns struct { + Id string // 主键 + MemberId string // 管理员id + OrderType string // 订单类型 + ProductId string // 产品id + OrderSn string // 关联订单号 + Money string // 充值金额 + Remark string // 备注 + RefundReason string // 退款原因 + RejectRefundReason string // 拒绝退款原因 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// adminOrderColumns holds the columns for the table hg_admin_order. +var adminOrderColumns = AdminOrderColumns{ + Id: "id", + MemberId: "member_id", + OrderType: "order_type", + ProductId: "product_id", + OrderSn: "order_sn", + Money: "money", + Remark: "remark", + RefundReason: "refund_reason", + RejectRefundReason: "reject_refund_reason", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAdminOrderDao creates and returns a new DAO object for table data access. +func NewAdminOrderDao(handlers ...gdb.ModelHandler) *AdminOrderDao { + return &AdminOrderDao{ + group: "default", + table: "hg_admin_order", + columns: adminOrderColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminOrderDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminOrderDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminOrderDao) Columns() AdminOrderColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminOrderDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminOrderDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_post.go b/server/internal/dao/internal/admin_post.go new file mode 100755 index 0000000..986103d --- /dev/null +++ b/server/internal/dao/internal/admin_post.go @@ -0,0 +1,93 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminPostDao is the data access object for the table hg_admin_post. +type AdminPostDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminPostColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminPostColumns defines and stores column names for the table hg_admin_post. +type AdminPostColumns struct { + Id string // 岗位ID + Code string // 岗位编码 + Name string // 岗位名称 + Remark string // 备注 + Sort string // 排序 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// adminPostColumns holds the columns for the table hg_admin_post. +var adminPostColumns = AdminPostColumns{ + Id: "id", + Code: "code", + Name: "name", + Remark: "remark", + Sort: "sort", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAdminPostDao creates and returns a new DAO object for table data access. +func NewAdminPostDao(handlers ...gdb.ModelHandler) *AdminPostDao { + return &AdminPostDao{ + group: "default", + table: "hg_admin_post", + columns: adminPostColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminPostDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminPostDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminPostDao) Columns() AdminPostColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminPostDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminPostDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_role.go b/server/internal/dao/internal/admin_role.go new file mode 100755 index 0000000..6d8a324 --- /dev/null +++ b/server/internal/dao/internal/admin_role.go @@ -0,0 +1,103 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminRoleDao is the data access object for the table hg_admin_role. +type AdminRoleDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminRoleColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminRoleColumns defines and stores column names for the table hg_admin_role. +type AdminRoleColumns struct { + Id string // 角色ID + Name string // 角色名称 + Key string // 角色权限字符串 + DataScope string // 数据范围 + CustomDept string // 自定义部门权限 + Pid string // 上级角色ID + Level string // 关系树等级 + Tree string // 关系树 + Remark string // 备注 + Sort string // 排序 + Status string // 角色状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// adminRoleColumns holds the columns for the table hg_admin_role. +var adminRoleColumns = AdminRoleColumns{ + Id: "id", + Name: "name", + Key: "key", + DataScope: "data_scope", + CustomDept: "custom_dept", + Pid: "pid", + Level: "level", + Tree: "tree", + Remark: "remark", + Sort: "sort", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAdminRoleDao creates and returns a new DAO object for table data access. +func NewAdminRoleDao(handlers ...gdb.ModelHandler) *AdminRoleDao { + return &AdminRoleDao{ + group: "default", + table: "hg_admin_role", + columns: adminRoleColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminRoleDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminRoleDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminRoleDao) Columns() AdminRoleColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminRoleDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminRoleDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_role_casbin.go b/server/internal/dao/internal/admin_role_casbin.go new file mode 100755 index 0000000..e00b886 --- /dev/null +++ b/server/internal/dao/internal/admin_role_casbin.go @@ -0,0 +1,93 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminRoleCasbinDao is the data access object for the table hg_admin_role_casbin. +type AdminRoleCasbinDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminRoleCasbinColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminRoleCasbinColumns defines and stores column names for the table hg_admin_role_casbin. +type AdminRoleCasbinColumns struct { + Id string // + PType string // + V0 string // + V1 string // + V2 string // + V3 string // + V4 string // + V5 string // +} + +// adminRoleCasbinColumns holds the columns for the table hg_admin_role_casbin. +var adminRoleCasbinColumns = AdminRoleCasbinColumns{ + Id: "id", + PType: "p_type", + V0: "v0", + V1: "v1", + V2: "v2", + V3: "v3", + V4: "v4", + V5: "v5", +} + +// NewAdminRoleCasbinDao creates and returns a new DAO object for table data access. +func NewAdminRoleCasbinDao(handlers ...gdb.ModelHandler) *AdminRoleCasbinDao { + return &AdminRoleCasbinDao{ + group: "default", + table: "hg_admin_role_casbin", + columns: adminRoleCasbinColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminRoleCasbinDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminRoleCasbinDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminRoleCasbinDao) Columns() AdminRoleCasbinColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminRoleCasbinDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminRoleCasbinDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminRoleCasbinDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/admin_role_menu.go b/server/internal/dao/internal/admin_role_menu.go new file mode 100755 index 0000000..9f9e4ff --- /dev/null +++ b/server/internal/dao/internal/admin_role_menu.go @@ -0,0 +1,81 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AdminRoleMenuDao is the data access object for the table hg_admin_role_menu. +type AdminRoleMenuDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AdminRoleMenuColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AdminRoleMenuColumns defines and stores column names for the table hg_admin_role_menu. +type AdminRoleMenuColumns struct { + RoleId string // 角色ID + MenuId string // 菜单ID +} + +// adminRoleMenuColumns holds the columns for the table hg_admin_role_menu. +var adminRoleMenuColumns = AdminRoleMenuColumns{ + RoleId: "role_id", + MenuId: "menu_id", +} + +// NewAdminRoleMenuDao creates and returns a new DAO object for table data access. +func NewAdminRoleMenuDao(handlers ...gdb.ModelHandler) *AdminRoleMenuDao { + return &AdminRoleMenuDao{ + group: "default", + table: "hg_admin_role_menu", + columns: adminRoleMenuColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AdminRoleMenuDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AdminRoleMenuDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AdminRoleMenuDao) Columns() AdminRoleMenuColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AdminRoleMenuDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AdminRoleMenuDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AdminRoleMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member.go b/server/internal/dao/internal/app_member.go new file mode 100644 index 0000000..abe7214 --- /dev/null +++ b/server/internal/dao/internal/app_member.go @@ -0,0 +1,135 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberDao is the data access object for the table hg_app_member. +type AppMemberDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberColumns defines and stores column names for the table hg_app_member. +type AppMemberColumns struct { + Id string // 主键 + TenantId string // 租户ID + MemberNo string // 会员编号 + Username string // 用户名 + MobileCipher string // 手机号密文(AES-GCM) + MobileHash string // 手机号检索哈希(HMAC-SHA256) + MobileMask string // 手机号脱敏值 + PasswordHash string // 登录密码哈希(bcrypt) + TradePasswordHash string // 交易密码哈希 + LevelId string // 会员等级ID + ParentId string // 上级会员ID + Level string // 团队层级 + Tree string // 关系树 + InviteCode string // 邀请码 + MemberStatus string // 会员状态 + RiskStatus string // 风控状态 + AutoDispatch string // 自动派单 + CreditScore string // 信用分 + IsTestAccount string // 测试账号 + LastLoginAt string // 最后登录时间 + LastLoginIpCipher string // 最后登录IP密文 + LastLoginIpMask string // 最后登录IP脱敏值 + LastLoginRegion string // 最后登录地区 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 注销时间 +} + +// appMemberColumns holds the columns for the table hg_app_member. +var appMemberColumns = AppMemberColumns{ + Id: "id", + TenantId: "tenant_id", + MemberNo: "member_no", + Username: "username", + MobileCipher: "mobile_cipher", + MobileHash: "mobile_hash", + MobileMask: "mobile_mask", + PasswordHash: "password_hash", + TradePasswordHash: "trade_password_hash", + LevelId: "level_id", + ParentId: "parent_id", + Level: "level", + Tree: "tree", + InviteCode: "invite_code", + MemberStatus: "member_status", + RiskStatus: "risk_status", + AutoDispatch: "auto_dispatch", + CreditScore: "credit_score", + IsTestAccount: "is_test_account", + LastLoginAt: "last_login_at", + LastLoginIpCipher: "last_login_ip_cipher", + LastLoginIpMask: "last_login_ip_mask", + LastLoginRegion: "last_login_region", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewAppMemberDao creates and returns a new DAO object for table data access. +func NewAppMemberDao(handlers ...gdb.ModelHandler) *AppMemberDao { + return &AppMemberDao{ + group: "default", + table: "hg_app_member", + columns: appMemberColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberDao) Columns() AppMemberColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member_address.go b/server/internal/dao/internal/app_member_address.go new file mode 100644 index 0000000..e13c2f9 --- /dev/null +++ b/server/internal/dao/internal/app_member_address.go @@ -0,0 +1,115 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberAddressDao is the data access object for the table hg_app_member_address. +type AppMemberAddressDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberAddressColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberAddressColumns defines and stores column names for the table hg_app_member_address. +type AppMemberAddressColumns struct { + Id string // 主键 + TenantId string // 租户ID + MemberId string // 会员ID + ReceiverCipher string // 收货人密文 + ReceiverMask string // 收货人脱敏值 + MobileCipher string // 手机号密文 + MobileMask string // 手机号脱敏值 + Province string // 省 + City string // 市 + District string // 区县 + AddressCipher string // 详细地址密文 + AddressMask string // 详细地址脱敏值 + IsDefault string // 默认地址 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// appMemberAddressColumns holds the columns for the table hg_app_member_address. +var appMemberAddressColumns = AppMemberAddressColumns{ + Id: "id", + TenantId: "tenant_id", + MemberId: "member_id", + ReceiverCipher: "receiver_cipher", + ReceiverMask: "receiver_mask", + MobileCipher: "mobile_cipher", + MobileMask: "mobile_mask", + Province: "province", + City: "city", + District: "district", + AddressCipher: "address_cipher", + AddressMask: "address_mask", + IsDefault: "is_default", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewAppMemberAddressDao creates and returns a new DAO object for table data access. +func NewAppMemberAddressDao(handlers ...gdb.ModelHandler) *AppMemberAddressDao { + return &AppMemberAddressDao{ + group: "default", + table: "hg_app_member_address", + columns: appMemberAddressColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberAddressDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberAddressDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberAddressDao) Columns() AppMemberAddressColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberAddressDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberAddressDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberAddressDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member_level.go b/server/internal/dao/internal/app_member_level.go new file mode 100644 index 0000000..501cff0 --- /dev/null +++ b/server/internal/dao/internal/app_member_level.go @@ -0,0 +1,111 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberLevelDao is the data access object for the table hg_app_member_level. +type AppMemberLevelDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberLevelColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberLevelColumns defines and stores column names for the table hg_app_member_level. +type AppMemberLevelColumns struct { + Id string // 主键 + TenantId string // 租户ID + LevelCode string // 稳定等级编码 + Name string // 等级名称 + IconAttachmentId string // 图标附件ID + IconUrl string // 图标URL + CurrentVersionId string // 当前发布版本ID + MemberCount string // 会员数(可重建) + Status string // 状态 1正常 2停用 + Sort string // 排序 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// appMemberLevelColumns holds the columns for the table hg_app_member_level. +var appMemberLevelColumns = AppMemberLevelColumns{ + Id: "id", + TenantId: "tenant_id", + LevelCode: "level_code", + Name: "name", + IconAttachmentId: "icon_attachment_id", + IconUrl: "icon_url", + CurrentVersionId: "current_version_id", + MemberCount: "member_count", + Status: "status", + Sort: "sort", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewAppMemberLevelDao creates and returns a new DAO object for table data access. +func NewAppMemberLevelDao(handlers ...gdb.ModelHandler) *AppMemberLevelDao { + return &AppMemberLevelDao{ + group: "default", + table: "hg_app_member_level", + columns: appMemberLevelColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberLevelDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberLevelDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberLevelDao) Columns() AppMemberLevelColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberLevelDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberLevelDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberLevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member_level_version.go b/server/internal/dao/internal/app_member_level_version.go new file mode 100644 index 0000000..02932dc --- /dev/null +++ b/server/internal/dao/internal/app_member_level_version.go @@ -0,0 +1,119 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberLevelVersionDao is the data access object for the table hg_app_member_level_version. +type AppMemberLevelVersionDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberLevelVersionColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberLevelVersionColumns defines and stores column names for the table hg_app_member_level_version. +type AppMemberLevelVersionColumns struct { + Id string // 主键 + TenantId string // 租户ID + LevelId string // 等级ID + VersionNo string // 版本号 + UpgradeAmount string // 升级金额(分) + GiftAmount string // 赠送金额(分) + DailyOrderLimit string // 每日接单次数 + CommissionRate string // 佣金万分比 + DailyWithdrawLimit string // 每日提现次数 + RuleJson string // 扩展规则快照 + PublishStatus string // 发布状态 + EffectiveAt string // 计划生效时间 + PublishedAt string // 发布时间 + ApprovalRequestId string // 审批单ID + BaseVersionId string // 基础版本ID + Version string // 乐观锁 + Remark string // 变更说明 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// appMemberLevelVersionColumns holds the columns for the table hg_app_member_level_version. +var appMemberLevelVersionColumns = AppMemberLevelVersionColumns{ + Id: "id", + TenantId: "tenant_id", + LevelId: "level_id", + VersionNo: "version_no", + UpgradeAmount: "upgrade_amount", + GiftAmount: "gift_amount", + DailyOrderLimit: "daily_order_limit", + CommissionRate: "commission_rate", + DailyWithdrawLimit: "daily_withdraw_limit", + RuleJson: "rule_json", + PublishStatus: "publish_status", + EffectiveAt: "effective_at", + PublishedAt: "published_at", + ApprovalRequestId: "approval_request_id", + BaseVersionId: "base_version_id", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAppMemberLevelVersionDao creates and returns a new DAO object for table data access. +func NewAppMemberLevelVersionDao(handlers ...gdb.ModelHandler) *AppMemberLevelVersionDao { + return &AppMemberLevelVersionDao{ + group: "default", + table: "hg_app_member_level_version", + columns: appMemberLevelVersionColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberLevelVersionDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberLevelVersionDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberLevelVersionDao) Columns() AppMemberLevelVersionColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberLevelVersionDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberLevelVersionDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberLevelVersionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member_notice.go b/server/internal/dao/internal/app_member_notice.go new file mode 100644 index 0000000..189b660 --- /dev/null +++ b/server/internal/dao/internal/app_member_notice.go @@ -0,0 +1,103 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberNoticeDao is the data access object for the table hg_app_member_notice. +type AppMemberNoticeDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberNoticeColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberNoticeColumns defines and stores column names for the table hg_app_member_notice. +type AppMemberNoticeColumns struct { + Id string // 主键 + TenantId string // 租户ID + MemberId string // 会员ID,0为全体 + Title string // 标题 + Content string // 内容 + SourceType string // 来源 1真实通知 2运营模拟 + StartAt string // 开始时间 + EndAt string // 结束时间 + NoticeStatus string // 状态 1有效 2撤回 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// appMemberNoticeColumns holds the columns for the table hg_app_member_notice. +var appMemberNoticeColumns = AppMemberNoticeColumns{ + Id: "id", + TenantId: "tenant_id", + MemberId: "member_id", + Title: "title", + Content: "content", + SourceType: "source_type", + StartAt: "start_at", + EndAt: "end_at", + NoticeStatus: "notice_status", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAppMemberNoticeDao creates and returns a new DAO object for table data access. +func NewAppMemberNoticeDao(handlers ...gdb.ModelHandler) *AppMemberNoticeDao { + return &AppMemberNoticeDao{ + group: "default", + table: "hg_app_member_notice", + columns: appMemberNoticeColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberNoticeDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberNoticeDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberNoticeDao) Columns() AppMemberNoticeColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberNoticeDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberNoticeDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberNoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member_payment_account.go b/server/internal/dao/internal/app_member_payment_account.go new file mode 100644 index 0000000..6f3f3ac --- /dev/null +++ b/server/internal/dao/internal/app_member_payment_account.go @@ -0,0 +1,121 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberPaymentAccountDao is the data access object for the table hg_app_member_payment_account. +type AppMemberPaymentAccountDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberPaymentAccountColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberPaymentAccountColumns defines and stores column names for the table hg_app_member_payment_account. +type AppMemberPaymentAccountColumns struct { + Id string // 主键 + TenantId string // 租户ID + MemberId string // 会员ID + AccountType string // 账户类型 + BankCode string // 银行编码 + BankName string // 银行名称 + HolderCipher string // 持有人密文 + HolderMask string // 持有人脱敏值 + MobileCipher string // 预留手机号密文 + MobileMask string // 预留手机号脱敏值 + AccountNoCipher string // 账号密文 + AccountNoHash string // 账号检索哈希 + AccountNoMask string // 账号脱敏值 + QrAttachmentId string // 收款码附件ID + VerifyStatus string // 核验状态 + IsDefault string // 默认账户 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// appMemberPaymentAccountColumns holds the columns for the table hg_app_member_payment_account. +var appMemberPaymentAccountColumns = AppMemberPaymentAccountColumns{ + Id: "id", + TenantId: "tenant_id", + MemberId: "member_id", + AccountType: "account_type", + BankCode: "bank_code", + BankName: "bank_name", + HolderCipher: "holder_cipher", + HolderMask: "holder_mask", + MobileCipher: "mobile_cipher", + MobileMask: "mobile_mask", + AccountNoCipher: "account_no_cipher", + AccountNoHash: "account_no_hash", + AccountNoMask: "account_no_mask", + QrAttachmentId: "qr_attachment_id", + VerifyStatus: "verify_status", + IsDefault: "is_default", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewAppMemberPaymentAccountDao creates and returns a new DAO object for table data access. +func NewAppMemberPaymentAccountDao(handlers ...gdb.ModelHandler) *AppMemberPaymentAccountDao { + return &AppMemberPaymentAccountDao{ + group: "default", + table: "hg_app_member_payment_account", + columns: appMemberPaymentAccountColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberPaymentAccountDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberPaymentAccountDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberPaymentAccountDao) Columns() AppMemberPaymentAccountColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberPaymentAccountDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberPaymentAccountDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberPaymentAccountDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member_profile.go b/server/internal/dao/internal/app_member_profile.go new file mode 100644 index 0000000..af5d6c5 --- /dev/null +++ b/server/internal/dao/internal/app_member_profile.go @@ -0,0 +1,107 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberProfileDao is the data access object for the table hg_app_member_profile. +type AppMemberProfileDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberProfileColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberProfileColumns defines and stores column names for the table hg_app_member_profile. +type AppMemberProfileColumns struct { + Id string // 主键 + TenantId string // 租户ID + MemberId string // 会员ID + RealNameCipher string // 真实姓名密文 + RealNameMask string // 真实姓名脱敏值 + IdNoCipher string // 证件号密文 + IdNoHash string // 证件号检索哈希 + IdNoMask string // 证件号脱敏值 + AvatarAttachmentId string // 头像附件ID + KycStatus string // 实名状态 + KycVerifiedAt string // 实名时间 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// appMemberProfileColumns holds the columns for the table hg_app_member_profile. +var appMemberProfileColumns = AppMemberProfileColumns{ + Id: "id", + TenantId: "tenant_id", + MemberId: "member_id", + RealNameCipher: "real_name_cipher", + RealNameMask: "real_name_mask", + IdNoCipher: "id_no_cipher", + IdNoHash: "id_no_hash", + IdNoMask: "id_no_mask", + AvatarAttachmentId: "avatar_attachment_id", + KycStatus: "kyc_status", + KycVerifiedAt: "kyc_verified_at", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewAppMemberProfileDao creates and returns a new DAO object for table data access. +func NewAppMemberProfileDao(handlers ...gdb.ModelHandler) *AppMemberProfileDao { + return &AppMemberProfileDao{ + group: "default", + table: "hg_app_member_profile", + columns: appMemberProfileColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberProfileDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberProfileDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberProfileDao) Columns() AppMemberProfileColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberProfileDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberProfileDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberProfileDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/app_member_status_log.go b/server/internal/dao/internal/app_member_status_log.go new file mode 100644 index 0000000..e96182d --- /dev/null +++ b/server/internal/dao/internal/app_member_status_log.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// AppMemberStatusLogDao is the data access object for the table hg_app_member_status_log. +type AppMemberStatusLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns AppMemberStatusLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// AppMemberStatusLogColumns defines and stores column names for the table hg_app_member_status_log. +type AppMemberStatusLogColumns struct { + Id string // 主键 + TenantId string // 租户ID + MemberId string // 会员ID + FromStatus string // 原状态 + ToStatus string // 目标状态 + ReasonCode string // 原因编码 + ReasonText string // 原因说明 + EffectiveAt string // 生效时间 + ExpireAt string // 失效时间 + ApprovalRequestId string // 审批单ID + OperatorId string // 执行人 + CreatedAt string // 创建时间 +} + +// appMemberStatusLogColumns holds the columns for the table hg_app_member_status_log. +var appMemberStatusLogColumns = AppMemberStatusLogColumns{ + Id: "id", + TenantId: "tenant_id", + MemberId: "member_id", + FromStatus: "from_status", + ToStatus: "to_status", + ReasonCode: "reason_code", + ReasonText: "reason_text", + EffectiveAt: "effective_at", + ExpireAt: "expire_at", + ApprovalRequestId: "approval_request_id", + OperatorId: "operator_id", + CreatedAt: "created_at", +} + +// NewAppMemberStatusLogDao creates and returns a new DAO object for table data access. +func NewAppMemberStatusLogDao(handlers ...gdb.ModelHandler) *AppMemberStatusLogDao { + return &AppMemberStatusLogDao{ + group: "default", + table: "hg_app_member_status_log", + columns: appMemberStatusLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *AppMemberStatusLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *AppMemberStatusLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *AppMemberStatusLogDao) Columns() AppMemberStatusLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *AppMemberStatusLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *AppMemberStatusLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *AppMemberStatusLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/approval_action.go b/server/internal/dao/internal/approval_action.go new file mode 100644 index 0000000..d1c1353 --- /dev/null +++ b/server/internal/dao/internal/approval_action.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ApprovalActionDao is the data access object for the table hg_approval_action. +type ApprovalActionDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ApprovalActionColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// ApprovalActionColumns defines and stores column names for the table hg_approval_action. +type ApprovalActionColumns struct { + Id string // 主键 + TenantId string // 租户ID + ApprovalRequestId string // 审批请求ID + StepNo string // 节点顺序 + ActorId string // 操作人 + Action string // 审批动作 + ReasonCode string // 原因编码 + Comment string // 审批意见 + SnapshotJson string // 操作时快照 + ActorIpCipher string // 操作IP密文 + MfaVerified string // 是否二次认证 + CreatedAt string // 创建时间 +} + +// approvalActionColumns holds the columns for the table hg_approval_action. +var approvalActionColumns = ApprovalActionColumns{ + Id: "id", + TenantId: "tenant_id", + ApprovalRequestId: "approval_request_id", + StepNo: "step_no", + ActorId: "actor_id", + Action: "action", + ReasonCode: "reason_code", + Comment: "comment", + SnapshotJson: "snapshot_json", + ActorIpCipher: "actor_ip_cipher", + MfaVerified: "mfa_verified", + CreatedAt: "created_at", +} + +// NewApprovalActionDao creates and returns a new DAO object for table data access. +func NewApprovalActionDao(handlers ...gdb.ModelHandler) *ApprovalActionDao { + return &ApprovalActionDao{ + group: "default", + table: "hg_approval_action", + columns: approvalActionColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ApprovalActionDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ApprovalActionDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ApprovalActionDao) Columns() ApprovalActionColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ApprovalActionDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ApprovalActionDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ApprovalActionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/approval_request.go b/server/internal/dao/internal/approval_request.go new file mode 100644 index 0000000..c0aed92 --- /dev/null +++ b/server/internal/dao/internal/approval_request.go @@ -0,0 +1,125 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ApprovalRequestDao is the data access object for the table hg_approval_request. +type ApprovalRequestDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ApprovalRequestColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// ApprovalRequestColumns defines and stores column names for the table hg_approval_request. +type ApprovalRequestColumns struct { + Id string // 主键 + TenantId string // 租户ID + ApprovalNo string // 审批单号 + ApprovalType string // 审批类型 + TargetType string // 目标类型 + TargetId string // 目标ID + Action string // 拟执行动作 + Title string // 审批标题 + PayloadJson string // 待执行数据快照 + DiffJson string // 前后差异 + RiskLevel string // 风险级别 + RequiredApprovals string // 需要通过数 + ApprovalStatus string // 审批状态 + ApplicantId string // 申请人 + SubmittedAt string // 提交时间 + DecidedAt string // 决定时间 + ExecutedAt string // 执行时间 + ExpireAt string // 超时时间 + Version string // 乐观锁 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// approvalRequestColumns holds the columns for the table hg_approval_request. +var approvalRequestColumns = ApprovalRequestColumns{ + Id: "id", + TenantId: "tenant_id", + ApprovalNo: "approval_no", + ApprovalType: "approval_type", + TargetType: "target_type", + TargetId: "target_id", + Action: "action", + Title: "title", + PayloadJson: "payload_json", + DiffJson: "diff_json", + RiskLevel: "risk_level", + RequiredApprovals: "required_approvals", + ApprovalStatus: "approval_status", + ApplicantId: "applicant_id", + SubmittedAt: "submitted_at", + DecidedAt: "decided_at", + ExecutedAt: "executed_at", + ExpireAt: "expire_at", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewApprovalRequestDao creates and returns a new DAO object for table data access. +func NewApprovalRequestDao(handlers ...gdb.ModelHandler) *ApprovalRequestDao { + return &ApprovalRequestDao{ + group: "default", + table: "hg_approval_request", + columns: approvalRequestColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ApprovalRequestDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ApprovalRequestDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ApprovalRequestDao) Columns() ApprovalRequestColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ApprovalRequestDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ApprovalRequestDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ApprovalRequestDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/banner.go b/server/internal/dao/internal/banner.go new file mode 100644 index 0000000..d6abe64 --- /dev/null +++ b/server/internal/dao/internal/banner.go @@ -0,0 +1,119 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// BannerDao is the data access object for the table hg_banner. +type BannerDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns BannerColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// BannerColumns defines and stores column names for the table hg_banner. +type BannerColumns struct { + Id string // 主键 + TenantId string // 租户ID + Name string // 后台名称 + Position string // 投放位置 + ImageAttachmentId string // 图片附件ID + ImageUrl string // 图片URL + AltText string // 替代文本 + TargetType string // 跳转类型 + TargetValue string // 跳转值 + StartAt string // 开始时间 + EndAt string // 结束时间 + PublishStatus string // 发布状态 + Sort string // 排序 + Version string // 乐观锁 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// bannerColumns holds the columns for the table hg_banner. +var bannerColumns = BannerColumns{ + Id: "id", + TenantId: "tenant_id", + Name: "name", + Position: "position", + ImageAttachmentId: "image_attachment_id", + ImageUrl: "image_url", + AltText: "alt_text", + TargetType: "target_type", + TargetValue: "target_value", + StartAt: "start_at", + EndAt: "end_at", + PublishStatus: "publish_status", + Sort: "sort", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewBannerDao creates and returns a new DAO object for table data access. +func NewBannerDao(handlers ...gdb.ModelHandler) *BannerDao { + return &BannerDao{ + group: "default", + table: "hg_banner", + columns: bannerColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *BannerDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *BannerDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *BannerDao) Columns() BannerColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *BannerDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *BannerDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *BannerDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/biz_audit_log.go b/server/internal/dao/internal/biz_audit_log.go new file mode 100644 index 0000000..c5133e6 --- /dev/null +++ b/server/internal/dao/internal/biz_audit_log.go @@ -0,0 +1,113 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// BizAuditLogDao is the data access object for the table hg_biz_audit_log. +type BizAuditLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns BizAuditLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// BizAuditLogColumns defines and stores column names for the table hg_biz_audit_log. +type BizAuditLogColumns struct { + Id string // 主键 + TenantId string // 租户ID + AuditNo string // 审计号 + ActorType string // 操作人类型 + ActorId string // 操作人ID + Module string // 业务模块 + Action string // 操作动作 + TargetType string // 目标类型 + TargetId string // 目标ID + BeforeDigest string // 变更前摘要 + AfterDigest string // 变更后摘要 + ChangeJson string // 已脱敏差异 + Reason string // 操作原因 + ApprovalNo string // 审批单号 + TraceId string // 链路ID + PrevHash string // 前一条哈希 + RowHash string // 当前行哈希 + CreatedAt string // 创建时间 +} + +// bizAuditLogColumns holds the columns for the table hg_biz_audit_log. +var bizAuditLogColumns = BizAuditLogColumns{ + Id: "id", + TenantId: "tenant_id", + AuditNo: "audit_no", + ActorType: "actor_type", + ActorId: "actor_id", + Module: "module", + Action: "action", + TargetType: "target_type", + TargetId: "target_id", + BeforeDigest: "before_digest", + AfterDigest: "after_digest", + ChangeJson: "change_json", + Reason: "reason", + ApprovalNo: "approval_no", + TraceId: "trace_id", + PrevHash: "prev_hash", + RowHash: "row_hash", + CreatedAt: "created_at", +} + +// NewBizAuditLogDao creates and returns a new DAO object for table data access. +func NewBizAuditLogDao(handlers ...gdb.ModelHandler) *BizAuditLogDao { + return &BizAuditLogDao{ + group: "default", + table: "hg_biz_audit_log", + columns: bizAuditLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *BizAuditLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *BizAuditLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *BizAuditLogDao) Columns() BizAuditLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *BizAuditLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *BizAuditLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *BizAuditLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/content.go b/server/internal/dao/internal/content.go new file mode 100644 index 0000000..aac7f11 --- /dev/null +++ b/server/internal/dao/internal/content.go @@ -0,0 +1,111 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ContentDao is the data access object for the table hg_content. +type ContentDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ContentColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// ContentColumns defines and stores column names for the table hg_content. +type ContentColumns struct { + Id string // 主键 + TenantId string // 租户ID + ContentKey string // 稳定内容标识 + ContentType string // 内容类型 + Title string // 后台标题 + PublishedVersionId string // 当前发布版本ID + PublishStatus string // 发布状态 + PublishedAt string // 发布时间 + Sort string // 排序 + Version string // 乐观锁 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// contentColumns holds the columns for the table hg_content. +var contentColumns = ContentColumns{ + Id: "id", + TenantId: "tenant_id", + ContentKey: "content_key", + ContentType: "content_type", + Title: "title", + PublishedVersionId: "published_version_id", + PublishStatus: "publish_status", + PublishedAt: "published_at", + Sort: "sort", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewContentDao creates and returns a new DAO object for table data access. +func NewContentDao(handlers ...gdb.ModelHandler) *ContentDao { + return &ContentDao{ + group: "default", + table: "hg_content", + columns: contentColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ContentDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ContentDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ContentDao) Columns() ContentColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ContentDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ContentDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ContentDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/content_version.go b/server/internal/dao/internal/content_version.go new file mode 100644 index 0000000..3e6268b --- /dev/null +++ b/server/internal/dao/internal/content_version.go @@ -0,0 +1,107 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ContentVersionDao is the data access object for the table hg_content_version. +type ContentVersionDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ContentVersionColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// ContentVersionColumns defines and stores column names for the table hg_content_version. +type ContentVersionColumns struct { + Id string // 主键 + TenantId string // 租户ID + ContentId string // 内容ID + VersionNo string // 版本号 + Title string // 展示标题 + Summary string // 摘要 + BodyHtml string // 清洗后HTML + BodyText string // 降级文本 + CoverUrl string // 封面图片URL + AssetIds string // 引用附件ID + PublishStatus string // 发布状态 + EffectiveAt string // 计划生效时间 + ApprovalRequestId string // 审批单ID + CreatedBy string // 创建者 + CreatedAt string // 创建时间 +} + +// contentVersionColumns holds the columns for the table hg_content_version. +var contentVersionColumns = ContentVersionColumns{ + Id: "id", + TenantId: "tenant_id", + ContentId: "content_id", + VersionNo: "version_no", + Title: "title", + Summary: "summary", + BodyHtml: "body_html", + BodyText: "body_text", + CoverUrl: "cover_url", + AssetIds: "asset_ids", + PublishStatus: "publish_status", + EffectiveAt: "effective_at", + ApprovalRequestId: "approval_request_id", + CreatedBy: "created_by", + CreatedAt: "created_at", +} + +// NewContentVersionDao creates and returns a new DAO object for table data access. +func NewContentVersionDao(handlers ...gdb.ModelHandler) *ContentVersionDao { + return &ContentVersionDao{ + group: "default", + table: "hg_content_version", + columns: contentVersionColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ContentVersionDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ContentVersionDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ContentVersionDao) Columns() ContentVersionColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ContentVersionDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ContentVersionDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ContentVersionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/customer_service.go b/server/internal/dao/internal/customer_service.go new file mode 100644 index 0000000..f9c4e48 --- /dev/null +++ b/server/internal/dao/internal/customer_service.go @@ -0,0 +1,115 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// CustomerServiceDao is the data access object for the table hg_customer_service. +type CustomerServiceDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns CustomerServiceColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// CustomerServiceColumns defines and stores column names for the table hg_customer_service. +type CustomerServiceColumns struct { + Id string // 主键 + TenantId string // 租户ID + ServiceCode string // 客服编码 + Name string // 客服名称 + AvatarUrl string // 头像地址 + WorkTime string // 工作时间说明 + OnlineStatus string // 在线状态 + ServiceUrl string // 客服跳转URL + BackupContact string // 备用联系方式 + SessionMapping string // 第三方会话映射 + Status string // 状态 + Sort string // 排序 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// customerServiceColumns holds the columns for the table hg_customer_service. +var customerServiceColumns = CustomerServiceColumns{ + Id: "id", + TenantId: "tenant_id", + ServiceCode: "service_code", + Name: "name", + AvatarUrl: "avatar_url", + WorkTime: "work_time", + OnlineStatus: "online_status", + ServiceUrl: "service_url", + BackupContact: "backup_contact", + SessionMapping: "session_mapping", + Status: "status", + Sort: "sort", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewCustomerServiceDao creates and returns a new DAO object for table data access. +func NewCustomerServiceDao(handlers ...gdb.ModelHandler) *CustomerServiceDao { + return &CustomerServiceDao{ + group: "default", + table: "hg_customer_service", + columns: customerServiceColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *CustomerServiceDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *CustomerServiceDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *CustomerServiceDao) Columns() CustomerServiceColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *CustomerServiceDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *CustomerServiceDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *CustomerServiceDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/dashboard_daily_stat.go b/server/internal/dao/internal/dashboard_daily_stat.go new file mode 100644 index 0000000..1b8766f --- /dev/null +++ b/server/internal/dao/internal/dashboard_daily_stat.go @@ -0,0 +1,99 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// DashboardDailyStatDao is the data access object for the table hg_dashboard_daily_stat. +type DashboardDailyStatDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns DashboardDailyStatColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// DashboardDailyStatColumns defines and stores column names for the table hg_dashboard_daily_stat. +type DashboardDailyStatColumns struct { + Id string // 主键 + TenantId string // 租户ID + StatDate string // 统计日期 + DimensionType string // 维度类型 + DimensionValue string // 维度值 + MetricCode string // 指标编码 + MetricCount string // 指标数量 + MetricAmount string // 指标金额(最小货币单位) + CalculatedAt string // 计算时间 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// dashboardDailyStatColumns holds the columns for the table hg_dashboard_daily_stat. +var dashboardDailyStatColumns = DashboardDailyStatColumns{ + Id: "id", + TenantId: "tenant_id", + StatDate: "stat_date", + DimensionType: "dimension_type", + DimensionValue: "dimension_value", + MetricCode: "metric_code", + MetricCount: "metric_count", + MetricAmount: "metric_amount", + CalculatedAt: "calculated_at", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewDashboardDailyStatDao creates and returns a new DAO object for table data access. +func NewDashboardDailyStatDao(handlers ...gdb.ModelHandler) *DashboardDailyStatDao { + return &DashboardDailyStatDao{ + group: "default", + table: "hg_dashboard_daily_stat", + columns: dashboardDailyStatColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *DashboardDailyStatDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *DashboardDailyStatDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *DashboardDailyStatDao) Columns() DashboardDailyStatColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *DashboardDailyStatDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *DashboardDailyStatDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *DashboardDailyStatDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/finance_review.go b/server/internal/dao/internal/finance_review.go new file mode 100644 index 0000000..0ba0399 --- /dev/null +++ b/server/internal/dao/internal/finance_review.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// FinanceReviewDao is the data access object for the table hg_finance_review. +type FinanceReviewDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns FinanceReviewColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// FinanceReviewColumns defines and stores column names for the table hg_finance_review. +type FinanceReviewColumns struct { + Id string // 主键 + TenantId string // 租户ID + ApprovalRequestId string // 审批单ID + BizType string // 业务类型 + BizId string // 业务ID + ReviewStage string // 审核阶段 + ReviewerId string // 审核人 + Decision string // 审核结论 + ReasonCode string // 原因编码 + ReasonText string // 审核说明 + SnapshotJson string // 审核快照 + CreatedAt string // 创建时间 +} + +// financeReviewColumns holds the columns for the table hg_finance_review. +var financeReviewColumns = FinanceReviewColumns{ + Id: "id", + TenantId: "tenant_id", + ApprovalRequestId: "approval_request_id", + BizType: "biz_type", + BizId: "biz_id", + ReviewStage: "review_stage", + ReviewerId: "reviewer_id", + Decision: "decision", + ReasonCode: "reason_code", + ReasonText: "reason_text", + SnapshotJson: "snapshot_json", + CreatedAt: "created_at", +} + +// NewFinanceReviewDao creates and returns a new DAO object for table data access. +func NewFinanceReviewDao(handlers ...gdb.ModelHandler) *FinanceReviewDao { + return &FinanceReviewDao{ + group: "default", + table: "hg_finance_review", + columns: financeReviewColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *FinanceReviewDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *FinanceReviewDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *FinanceReviewDao) Columns() FinanceReviewColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *FinanceReviewDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *FinanceReviewDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *FinanceReviewDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/idempotency_record.go b/server/internal/dao/internal/idempotency_record.go new file mode 100644 index 0000000..a5ae6ab --- /dev/null +++ b/server/internal/dao/internal/idempotency_record.go @@ -0,0 +1,103 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// IdempotencyRecordDao is the data access object for the table hg_idempotency_record. +type IdempotencyRecordDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns IdempotencyRecordColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// IdempotencyRecordColumns defines and stores column names for the table hg_idempotency_record. +type IdempotencyRecordColumns struct { + Id string // 主键 + TenantId string // 租户ID + Scope string // 业务作用域 + IdempotencyKey string // 幂等键 + RequestDigest string // 请求摘要 + ResourceType string // 资源类型 + ResourceId string // 资源ID + ProcessStatus string // 处理状态 + ResponseCode string // 响应码 + ResponseDigest string // 响应摘要 + ExpireAt string // 过期时间 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// idempotencyRecordColumns holds the columns for the table hg_idempotency_record. +var idempotencyRecordColumns = IdempotencyRecordColumns{ + Id: "id", + TenantId: "tenant_id", + Scope: "scope", + IdempotencyKey: "idempotency_key", + RequestDigest: "request_digest", + ResourceType: "resource_type", + ResourceId: "resource_id", + ProcessStatus: "process_status", + ResponseCode: "response_code", + ResponseDigest: "response_digest", + ExpireAt: "expire_at", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewIdempotencyRecordDao creates and returns a new DAO object for table data access. +func NewIdempotencyRecordDao(handlers ...gdb.ModelHandler) *IdempotencyRecordDao { + return &IdempotencyRecordDao{ + group: "default", + table: "hg_idempotency_record", + columns: idempotencyRecordColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *IdempotencyRecordDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *IdempotencyRecordDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *IdempotencyRecordDao) Columns() IdempotencyRecordColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *IdempotencyRecordDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *IdempotencyRecordDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *IdempotencyRecordDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/outbox_event.go b/server/internal/dao/internal/outbox_event.go new file mode 100644 index 0000000..3d5e347 --- /dev/null +++ b/server/internal/dao/internal/outbox_event.go @@ -0,0 +1,103 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// OutboxEventDao is the data access object for the table hg_outbox_event. +type OutboxEventDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns OutboxEventColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// OutboxEventColumns defines and stores column names for the table hg_outbox_event. +type OutboxEventColumns struct { + Id string // 主键 + TenantId string // 租户ID + EventNo string // 事件号 + AggregateType string // 聚合根类型 + AggregateId string // 聚合根ID + EventType string // 事件类型 + PayloadJson string // 已脱敏事件数据 + PublishStatus string // 发送状态 + RetryCount string // 重试次数 + NextRetryAt string // 下次重试时间 + LastError string // 最后错误 + CreatedAt string // 创建时间 + PublishedAt string // 发送时间 +} + +// outboxEventColumns holds the columns for the table hg_outbox_event. +var outboxEventColumns = OutboxEventColumns{ + Id: "id", + TenantId: "tenant_id", + EventNo: "event_no", + AggregateType: "aggregate_type", + AggregateId: "aggregate_id", + EventType: "event_type", + PayloadJson: "payload_json", + PublishStatus: "publish_status", + RetryCount: "retry_count", + NextRetryAt: "next_retry_at", + LastError: "last_error", + CreatedAt: "created_at", + PublishedAt: "published_at", +} + +// NewOutboxEventDao creates and returns a new DAO object for table data access. +func NewOutboxEventDao(handlers ...gdb.ModelHandler) *OutboxEventDao { + return &OutboxEventDao{ + group: "default", + table: "hg_outbox_event", + columns: outboxEventColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *OutboxEventDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *OutboxEventDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *OutboxEventDao) Columns() OutboxEventColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *OutboxEventDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *OutboxEventDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *OutboxEventDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/pay_log.go b/server/internal/dao/internal/pay_log.go new file mode 100755 index 0000000..0ef4f61 --- /dev/null +++ b/server/internal/dao/internal/pay_log.go @@ -0,0 +1,137 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// PayLogDao is the data access object for the table hg_pay_log. +type PayLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns PayLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// PayLogColumns defines and stores column names for the table hg_pay_log. +type PayLogColumns struct { + Id string // 主键 + MemberId string // 会员ID + AppId string // 应用ID + AddonsName string // 插件名称 + OrderSn string // 关联订单号 + OrderGroup string // 组别[默认统一支付类型] + Openid string // openid + MchId string // 商户支付账户 + Subject string // 订单标题 + Detail string // 支付商品详情 + AuthCode string // 刷卡码 + OutTradeNo string // 商户订单号 + TransactionId string // 交易号 + PayType string // 支付类型 + PayAmount string // 支付金额 + ActualAmount string // 实付金额 + PayStatus string // 支付状态 + PayAt string // 支付时间 + TradeType string // 交易类型 + RefundSn string // 退款单号 + IsRefund string // 是否退款 + Custom string // 自定义参数 + CreateIp string // 创建者IP + PayIp string // 支付者IP + NotifyUrl string // 支付通知回调地址 + ReturnUrl string // 买家付款成功跳转地址 + TraceIds string // 链路ID集合 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// payLogColumns holds the columns for the table hg_pay_log. +var payLogColumns = PayLogColumns{ + Id: "id", + MemberId: "member_id", + AppId: "app_id", + AddonsName: "addons_name", + OrderSn: "order_sn", + OrderGroup: "order_group", + Openid: "openid", + MchId: "mch_id", + Subject: "subject", + Detail: "detail", + AuthCode: "auth_code", + OutTradeNo: "out_trade_no", + TransactionId: "transaction_id", + PayType: "pay_type", + PayAmount: "pay_amount", + ActualAmount: "actual_amount", + PayStatus: "pay_status", + PayAt: "pay_at", + TradeType: "trade_type", + RefundSn: "refund_sn", + IsRefund: "is_refund", + Custom: "custom", + CreateIp: "create_ip", + PayIp: "pay_ip", + NotifyUrl: "notify_url", + ReturnUrl: "return_url", + TraceIds: "trace_ids", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewPayLogDao creates and returns a new DAO object for table data access. +func NewPayLogDao(handlers ...gdb.ModelHandler) *PayLogDao { + return &PayLogDao{ + group: "default", + table: "hg_pay_log", + columns: payLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *PayLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *PayLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *PayLogDao) Columns() PayLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *PayLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *PayLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *PayLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/pay_refund.go b/server/internal/dao/internal/pay_refund.go new file mode 100755 index 0000000..8b7684f --- /dev/null +++ b/server/internal/dao/internal/pay_refund.go @@ -0,0 +1,103 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// PayRefundDao is the data access object for the table hg_pay_refund. +type PayRefundDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns PayRefundColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// PayRefundColumns defines and stores column names for the table hg_pay_refund. +type PayRefundColumns struct { + Id string // 主键ID + MemberId string // 会员ID + AppId string // 应用ID + OrderSn string // 业务订单号 + RefundTradeNo string // 退款交易号 + RefundMoney string // 退款金额 + RefundWay string // 退款方式 + Ip string // 申请者IP + Reason string // 申请退款原因 + Remark string // 退款备注 + Status string // 退款状态 + CreatedAt string // 申请时间 + UpdatedAt string // 更新时间 +} + +// payRefundColumns holds the columns for the table hg_pay_refund. +var payRefundColumns = PayRefundColumns{ + Id: "id", + MemberId: "member_id", + AppId: "app_id", + OrderSn: "order_sn", + RefundTradeNo: "refund_trade_no", + RefundMoney: "refund_money", + RefundWay: "refund_way", + Ip: "ip", + Reason: "reason", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewPayRefundDao creates and returns a new DAO object for table data access. +func NewPayRefundDao(handlers ...gdb.ModelHandler) *PayRefundDao { + return &PayRefundDao{ + group: "default", + table: "hg_pay_refund", + columns: payRefundColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *PayRefundDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *PayRefundDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *PayRefundDao) Columns() PayRefundColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *PayRefundDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *PayRefundDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *PayRefundDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/payment_channel.go b/server/internal/dao/internal/payment_channel.go new file mode 100644 index 0000000..78d87c4 --- /dev/null +++ b/server/internal/dao/internal/payment_channel.go @@ -0,0 +1,117 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// PaymentChannelDao is the data access object for the table hg_payment_channel. +type PaymentChannelDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns PaymentChannelColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// PaymentChannelColumns defines and stores column names for the table hg_payment_channel. +type PaymentChannelColumns struct { + Id string // 主键 + TenantId string // 租户ID + ChannelCode string // 渠道编码 + Name string // 渠道名称 + ChannelType string // 渠道类型 + Direction string // 支持方向 + ConfigCipher string // 渠道配置密文 + MinAmount string // 最小金额(分) + MaxAmount string // 最大金额(分) + FeeType string // 手续费类型 + FeeFixedAmount string // 固定手续费(分) + FeeRate string // 费率(万分比) + Status string // 状态 + Sort string // 排序 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// paymentChannelColumns holds the columns for the table hg_payment_channel. +var paymentChannelColumns = PaymentChannelColumns{ + Id: "id", + TenantId: "tenant_id", + ChannelCode: "channel_code", + Name: "name", + ChannelType: "channel_type", + Direction: "direction", + ConfigCipher: "config_cipher", + MinAmount: "min_amount", + MaxAmount: "max_amount", + FeeType: "fee_type", + FeeFixedAmount: "fee_fixed_amount", + FeeRate: "fee_rate", + Status: "status", + Sort: "sort", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewPaymentChannelDao creates and returns a new DAO object for table data access. +func NewPaymentChannelDao(handlers ...gdb.ModelHandler) *PaymentChannelDao { + return &PaymentChannelDao{ + group: "default", + table: "hg_payment_channel", + columns: paymentChannelColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *PaymentChannelDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *PaymentChannelDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *PaymentChannelDao) Columns() PaymentChannelColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *PaymentChannelDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *PaymentChannelDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *PaymentChannelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/product.go b/server/internal/dao/internal/product.go new file mode 100644 index 0000000..027b1b4 --- /dev/null +++ b/server/internal/dao/internal/product.go @@ -0,0 +1,129 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ProductDao is the data access object for the table hg_product. +type ProductDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ProductColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// ProductColumns defines and stores column names for the table hg_product. +type ProductColumns struct { + Id string // 主键 + TenantId string // 租户ID + ProductNo string // 商品编号 + CategoryId string // 分类ID + ProductType string // 商品类型 + PaymentType string // 支付方式 + Name string // 商品名称 + ShopName string // 店铺名称 + PriceAmount string // 单价(分) + Currency string // 币种 + CoverAttachmentId string // 封面附件ID + CoverUrl string // 封面URL + DetailHtml string // 商品详情 + IsRecommended string // 是否推荐 + PublishStatus string // 发布状态 + StartAt string // 展示开始时间 + EndAt string // 展示结束时间 + Sort string // 排序 + Version string // 乐观锁 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// productColumns holds the columns for the table hg_product. +var productColumns = ProductColumns{ + Id: "id", + TenantId: "tenant_id", + ProductNo: "product_no", + CategoryId: "category_id", + ProductType: "product_type", + PaymentType: "payment_type", + Name: "name", + ShopName: "shop_name", + PriceAmount: "price_amount", + Currency: "currency", + CoverAttachmentId: "cover_attachment_id", + CoverUrl: "cover_url", + DetailHtml: "detail_html", + IsRecommended: "is_recommended", + PublishStatus: "publish_status", + StartAt: "start_at", + EndAt: "end_at", + Sort: "sort", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewProductDao creates and returns a new DAO object for table data access. +func NewProductDao(handlers ...gdb.ModelHandler) *ProductDao { + return &ProductDao{ + group: "default", + table: "hg_product", + columns: productColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ProductDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ProductDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ProductDao) Columns() ProductColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ProductDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ProductDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ProductDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/product_category.go b/server/internal/dao/internal/product_category.go new file mode 100644 index 0000000..7b1ba1c --- /dev/null +++ b/server/internal/dao/internal/product_category.go @@ -0,0 +1,107 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// ProductCategoryDao is the data access object for the table hg_product_category. +type ProductCategoryDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns ProductCategoryColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// ProductCategoryColumns defines and stores column names for the table hg_product_category. +type ProductCategoryColumns struct { + Id string // 主键 + TenantId string // 租户ID + Pid string // 上级ID + Level string // 树等级 + Tree string // 关系树 + CategoryCode string // 分类编码 + Name string // 分类名称 + Status string // 状态 + Sort string // 排序 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// productCategoryColumns holds the columns for the table hg_product_category. +var productCategoryColumns = ProductCategoryColumns{ + Id: "id", + TenantId: "tenant_id", + Pid: "pid", + Level: "level", + Tree: "tree", + CategoryCode: "category_code", + Name: "name", + Status: "status", + Sort: "sort", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewProductCategoryDao creates and returns a new DAO object for table data access. +func NewProductCategoryDao(handlers ...gdb.ModelHandler) *ProductCategoryDao { + return &ProductCategoryDao{ + group: "default", + table: "hg_product_category", + columns: productCategoryColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *ProductCategoryDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *ProductCategoryDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *ProductCategoryDao) Columns() ProductCategoryColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *ProductCategoryDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *ProductCategoryDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *ProductCategoryDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/recharge_order.go b/server/internal/dao/internal/recharge_order.go new file mode 100644 index 0000000..5981ce5 --- /dev/null +++ b/server/internal/dao/internal/recharge_order.go @@ -0,0 +1,125 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// RechargeOrderDao is the data access object for the table hg_recharge_order. +type RechargeOrderDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns RechargeOrderColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// RechargeOrderColumns defines and stores column names for the table hg_recharge_order. +type RechargeOrderColumns struct { + Id string // 主键 + TenantId string // 租户ID + RechargeNo string // 充值单号 + MemberId string // 会员ID + ChannelId string // 支付渠道ID + RequestAmount string // 申请金额(分) + PaidAmount string // 实付金额(分) + Currency string // 币种 + ExternalNo string // 外部支付单号 + VoucherAttachmentIds string // 打款凭证附件 + RechargeType string // 充值类型 + RechargeStatus string // 充值状态 + Remark string // 会员备注 + ReviewReasonCode string // 审核原因编码 + ReviewReason string // 审核意见 + ApprovalRequestId string // 审批单ID + LedgerId string // 入账台账ID + PaidAt string // 支付时间 + ReviewedAt string // 审核时间 + CreditedAt string // 入账时间 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// rechargeOrderColumns holds the columns for the table hg_recharge_order. +var rechargeOrderColumns = RechargeOrderColumns{ + Id: "id", + TenantId: "tenant_id", + RechargeNo: "recharge_no", + MemberId: "member_id", + ChannelId: "channel_id", + RequestAmount: "request_amount", + PaidAmount: "paid_amount", + Currency: "currency", + ExternalNo: "external_no", + VoucherAttachmentIds: "voucher_attachment_ids", + RechargeType: "recharge_type", + RechargeStatus: "recharge_status", + Remark: "remark", + ReviewReasonCode: "review_reason_code", + ReviewReason: "review_reason", + ApprovalRequestId: "approval_request_id", + LedgerId: "ledger_id", + PaidAt: "paid_at", + ReviewedAt: "reviewed_at", + CreditedAt: "credited_at", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewRechargeOrderDao creates and returns a new DAO object for table data access. +func NewRechargeOrderDao(handlers ...gdb.ModelHandler) *RechargeOrderDao { + return &RechargeOrderDao{ + group: "default", + table: "hg_recharge_order", + columns: rechargeOrderColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *RechargeOrderDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *RechargeOrderDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *RechargeOrderDao) Columns() RechargeOrderColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *RechargeOrderDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *RechargeOrderDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *RechargeOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sensitive_access_log.go b/server/internal/dao/internal/sensitive_access_log.go new file mode 100644 index 0000000..2014fb4 --- /dev/null +++ b/server/internal/dao/internal/sensitive_access_log.go @@ -0,0 +1,105 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SensitiveAccessLogDao is the data access object for the table hg_sensitive_access_log. +type SensitiveAccessLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SensitiveAccessLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SensitiveAccessLogColumns defines and stores column names for the table hg_sensitive_access_log. +type SensitiveAccessLogColumns struct { + Id string // 主键 + TenantId string // 租户ID + AccessNo string // 查看流水号 + ActorId string // 管理员ID + TargetType string // 目标类型 + TargetId string // 目标ID + FieldSet string // 查看字段集 + PurposeCode string // 用途编码 + PurposeText string // 用途说明 + AuthorizationNo string // 授权号 + MfaVerified string // 是否二次认证 + Result string // 查看结果 + TraceId string // 链路ID + CreatedAt string // 创建时间 +} + +// sensitiveAccessLogColumns holds the columns for the table hg_sensitive_access_log. +var sensitiveAccessLogColumns = SensitiveAccessLogColumns{ + Id: "id", + TenantId: "tenant_id", + AccessNo: "access_no", + ActorId: "actor_id", + TargetType: "target_type", + TargetId: "target_id", + FieldSet: "field_set", + PurposeCode: "purpose_code", + PurposeText: "purpose_text", + AuthorizationNo: "authorization_no", + MfaVerified: "mfa_verified", + Result: "result", + TraceId: "trace_id", + CreatedAt: "created_at", +} + +// NewSensitiveAccessLogDao creates and returns a new DAO object for table data access. +func NewSensitiveAccessLogDao(handlers ...gdb.ModelHandler) *SensitiveAccessLogDao { + return &SensitiveAccessLogDao{ + group: "default", + table: "hg_sensitive_access_log", + columns: sensitiveAccessLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SensitiveAccessLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SensitiveAccessLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SensitiveAccessLogDao) Columns() SensitiveAccessLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SensitiveAccessLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SensitiveAccessLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SensitiveAccessLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/site_config_version.go b/server/internal/dao/internal/site_config_version.go new file mode 100644 index 0000000..6fb2707 --- /dev/null +++ b/server/internal/dao/internal/site_config_version.go @@ -0,0 +1,113 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SiteConfigVersionDao is the data access object for the table hg_site_config_version. +type SiteConfigVersionDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SiteConfigVersionColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SiteConfigVersionColumns defines and stores column names for the table hg_site_config_version. +type SiteConfigVersionColumns struct { + Id string // 主键 + TenantId string // 租户ID + ConfigNo string // 配置版本号 + ConfigGroup string // 配置组 + SchemaVersion string // Schema版本 + ConfigJson string // 完整配置快照 + ConfigDigest string // 配置摘要 + PublishStatus string // 发布状态 + EffectiveAt string // 计划生效时间 + PublishedAt string // 实际发布时间 + ApprovalRequestId string // 审批单ID + BaseVersionId string // 基础版本ID + Version string // 乐观锁 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// siteConfigVersionColumns holds the columns for the table hg_site_config_version. +var siteConfigVersionColumns = SiteConfigVersionColumns{ + Id: "id", + TenantId: "tenant_id", + ConfigNo: "config_no", + ConfigGroup: "config_group", + SchemaVersion: "schema_version", + ConfigJson: "config_json", + ConfigDigest: "config_digest", + PublishStatus: "publish_status", + EffectiveAt: "effective_at", + PublishedAt: "published_at", + ApprovalRequestId: "approval_request_id", + BaseVersionId: "base_version_id", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSiteConfigVersionDao creates and returns a new DAO object for table data access. +func NewSiteConfigVersionDao(handlers ...gdb.ModelHandler) *SiteConfigVersionDao { + return &SiteConfigVersionDao{ + group: "default", + table: "hg_site_config_version", + columns: siteConfigVersionColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SiteConfigVersionDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SiteConfigVersionDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SiteConfigVersionDao) Columns() SiteConfigVersionColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SiteConfigVersionDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SiteConfigVersionDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SiteConfigVersionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_addons_config.go b/server/internal/dao/internal/sys_addons_config.go new file mode 100755 index 0000000..41135bb --- /dev/null +++ b/server/internal/dao/internal/sys_addons_config.go @@ -0,0 +1,105 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysAddonsConfigDao is the data access object for the table hg_sys_addons_config. +type SysAddonsConfigDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysAddonsConfigColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysAddonsConfigColumns defines and stores column names for the table hg_sys_addons_config. +type SysAddonsConfigColumns struct { + Id string // 配置ID + AddonName string // 插件名称 + Group string // 分组 + Name string // 参数名称 + Type string // 键值类型:string,int,uint,bool,datetime,date + Key string // 参数键名 + Value string // 参数键值 + DefaultValue string // 默认值 + Sort string // 排序 + Tip string // 变量描述 + IsDefault string // 是否为系统默认 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysAddonsConfigColumns holds the columns for the table hg_sys_addons_config. +var sysAddonsConfigColumns = SysAddonsConfigColumns{ + Id: "id", + AddonName: "addon_name", + Group: "group", + Name: "name", + Type: "type", + Key: "key", + Value: "value", + DefaultValue: "default_value", + Sort: "sort", + Tip: "tip", + IsDefault: "is_default", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysAddonsConfigDao creates and returns a new DAO object for table data access. +func NewSysAddonsConfigDao(handlers ...gdb.ModelHandler) *SysAddonsConfigDao { + return &SysAddonsConfigDao{ + group: "default", + table: "hg_sys_addons_config", + columns: sysAddonsConfigColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysAddonsConfigDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysAddonsConfigDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysAddonsConfigDao) Columns() SysAddonsConfigColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysAddonsConfigDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysAddonsConfigDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysAddonsConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_addons_install.go b/server/internal/dao/internal/sys_addons_install.go new file mode 100644 index 0000000..9611545 --- /dev/null +++ b/server/internal/dao/internal/sys_addons_install.go @@ -0,0 +1,89 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysAddonsInstallDao is the data access object for the table hg_sys_addons_install. +type SysAddonsInstallDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysAddonsInstallColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysAddonsInstallColumns defines and stores column names for the table hg_sys_addons_install. +type SysAddonsInstallColumns struct { + Id string // 主键 + Name string // 插件名称 + Version string // 版本号 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysAddonsInstallColumns holds the columns for the table hg_sys_addons_install. +var sysAddonsInstallColumns = SysAddonsInstallColumns{ + Id: "id", + Name: "name", + Version: "version", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysAddonsInstallDao creates and returns a new DAO object for table data access. +func NewSysAddonsInstallDao(handlers ...gdb.ModelHandler) *SysAddonsInstallDao { + return &SysAddonsInstallDao{ + group: "default", + table: "hg_sys_addons_install", + columns: sysAddonsInstallColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysAddonsInstallDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysAddonsInstallDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysAddonsInstallDao) Columns() SysAddonsInstallColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysAddonsInstallDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysAddonsInstallDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysAddonsInstallDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_attachment.go b/server/internal/dao/internal/sys_attachment.go new file mode 100755 index 0000000..dcd6558 --- /dev/null +++ b/server/internal/dao/internal/sys_attachment.go @@ -0,0 +1,111 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysAttachmentDao is the data access object for the table hg_sys_attachment. +type SysAttachmentDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysAttachmentColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysAttachmentColumns defines and stores column names for the table hg_sys_attachment. +type SysAttachmentColumns struct { + Id string // 文件ID + AppId string // 应用ID + MemberId string // 管理员ID + CateId string // 上传分类 + Drive string // 上传驱动 + Name string // 文件原始名 + Kind string // 上传类型 + MimeType string // 扩展类型 + NaiveType string // NaiveUI类型 + Path string // 本地路径 + FileUrl string // url + Size string // 文件大小 + Ext string // 扩展名 + Md5 string // md5校验码 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// sysAttachmentColumns holds the columns for the table hg_sys_attachment. +var sysAttachmentColumns = SysAttachmentColumns{ + Id: "id", + AppId: "app_id", + MemberId: "member_id", + CateId: "cate_id", + Drive: "drive", + Name: "name", + Kind: "kind", + MimeType: "mime_type", + NaiveType: "naive_type", + Path: "path", + FileUrl: "file_url", + Size: "size", + Ext: "ext", + Md5: "md5", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysAttachmentDao creates and returns a new DAO object for table data access. +func NewSysAttachmentDao(handlers ...gdb.ModelHandler) *SysAttachmentDao { + return &SysAttachmentDao{ + group: "default", + table: "hg_sys_attachment", + columns: sysAttachmentColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysAttachmentDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysAttachmentDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysAttachmentDao) Columns() SysAttachmentColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysAttachmentDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysAttachmentDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysAttachmentDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_blacklist.go b/server/internal/dao/internal/sys_blacklist.go new file mode 100755 index 0000000..1838a14 --- /dev/null +++ b/server/internal/dao/internal/sys_blacklist.go @@ -0,0 +1,89 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysBlacklistDao is the data access object for the table hg_sys_blacklist. +type SysBlacklistDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysBlacklistColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysBlacklistColumns defines and stores column names for the table hg_sys_blacklist. +type SysBlacklistColumns struct { + Id string // 黑名单ID + Ip string // IP地址 + Remark string // 备注 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysBlacklistColumns holds the columns for the table hg_sys_blacklist. +var sysBlacklistColumns = SysBlacklistColumns{ + Id: "id", + Ip: "ip", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysBlacklistDao creates and returns a new DAO object for table data access. +func NewSysBlacklistDao(handlers ...gdb.ModelHandler) *SysBlacklistDao { + return &SysBlacklistDao{ + group: "default", + table: "hg_sys_blacklist", + columns: sysBlacklistColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysBlacklistDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysBlacklistDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysBlacklistDao) Columns() SysBlacklistColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysBlacklistDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysBlacklistDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysBlacklistDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_config.go b/server/internal/dao/internal/sys_config.go new file mode 100755 index 0000000..637f6a2 --- /dev/null +++ b/server/internal/dao/internal/sys_config.go @@ -0,0 +1,103 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysConfigDao is the data access object for the table hg_sys_config. +type SysConfigDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysConfigColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysConfigColumns defines and stores column names for the table hg_sys_config. +type SysConfigColumns struct { + Id string // 配置ID + Group string // 配置分组 + Name string // 参数名称 + Type string // 键值类型:string,int,uint,bool,datetime,date + Key string // 参数键名 + Value string // 参数键值 + DefaultValue string // 默认值 + Sort string // 排序 + Tip string // 变量描述 + IsDefault string // 是否为系统默认 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysConfigColumns holds the columns for the table hg_sys_config. +var sysConfigColumns = SysConfigColumns{ + Id: "id", + Group: "group", + Name: "name", + Type: "type", + Key: "key", + Value: "value", + DefaultValue: "default_value", + Sort: "sort", + Tip: "tip", + IsDefault: "is_default", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysConfigDao creates and returns a new DAO object for table data access. +func NewSysConfigDao(handlers ...gdb.ModelHandler) *SysConfigDao { + return &SysConfigDao{ + group: "default", + table: "hg_sys_config", + columns: sysConfigColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysConfigDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysConfigDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysConfigDao) Columns() SysConfigColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysConfigDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysConfigDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_cron.go b/server/internal/dao/internal/sys_cron.go new file mode 100755 index 0000000..a8a8dac --- /dev/null +++ b/server/internal/dao/internal/sys_cron.go @@ -0,0 +1,103 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysCronDao is the data access object for the table hg_sys_cron. +type SysCronDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysCronColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysCronColumns defines and stores column names for the table hg_sys_cron. +type SysCronColumns struct { + Id string // 任务ID + GroupId string // 分组ID + Title string // 任务标题 + Name string // 任务方法 + Params string // 函数参数 + Pattern string // 表达式 + Policy string // 策略 + Count string // 执行次数 + Sort string // 排序 + Remark string // 备注 + Status string // 任务状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysCronColumns holds the columns for the table hg_sys_cron. +var sysCronColumns = SysCronColumns{ + Id: "id", + GroupId: "group_id", + Title: "title", + Name: "name", + Params: "params", + Pattern: "pattern", + Policy: "policy", + Count: "count", + Sort: "sort", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysCronDao creates and returns a new DAO object for table data access. +func NewSysCronDao(handlers ...gdb.ModelHandler) *SysCronDao { + return &SysCronDao{ + group: "default", + table: "hg_sys_cron", + columns: sysCronColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysCronDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysCronDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysCronDao) Columns() SysCronColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysCronDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysCronDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysCronDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_cron_group.go b/server/internal/dao/internal/sys_cron_group.go new file mode 100755 index 0000000..983a238 --- /dev/null +++ b/server/internal/dao/internal/sys_cron_group.go @@ -0,0 +1,95 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysCronGroupDao is the data access object for the table hg_sys_cron_group. +type SysCronGroupDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysCronGroupColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysCronGroupColumns defines and stores column names for the table hg_sys_cron_group. +type SysCronGroupColumns struct { + Id string // 任务分组ID + Pid string // 父类任务分组ID + Name string // 分组名称 + IsDefault string // 是否默认 + Sort string // 排序 + Remark string // 备注 + Status string // 分组状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysCronGroupColumns holds the columns for the table hg_sys_cron_group. +var sysCronGroupColumns = SysCronGroupColumns{ + Id: "id", + Pid: "pid", + Name: "name", + IsDefault: "is_default", + Sort: "sort", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysCronGroupDao creates and returns a new DAO object for table data access. +func NewSysCronGroupDao(handlers ...gdb.ModelHandler) *SysCronGroupDao { + return &SysCronGroupDao{ + group: "default", + table: "hg_sys_cron_group", + columns: sysCronGroupColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysCronGroupDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysCronGroupDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysCronGroupDao) Columns() SysCronGroupColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysCronGroupDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysCronGroupDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysCronGroupDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_dict_data.go b/server/internal/dao/internal/sys_dict_data.go new file mode 100755 index 0000000..89b72d5 --- /dev/null +++ b/server/internal/dao/internal/sys_dict_data.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysDictDataDao is the data access object for the table hg_sys_dict_data. +type SysDictDataDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysDictDataColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysDictDataColumns defines and stores column names for the table hg_sys_dict_data. +type SysDictDataColumns struct { + Id string // 字典数据ID + Label string // 字典标签 + Value string // 字典键值 + ValueType string // 键值数据类型:string,int,uint,bool,datetime,date + Type string // 字典类型 + ListClass string // 表格回显样式 + IsDefault string // 是否为系统默认 + Sort string // 字典排序 + Remark string // 备注 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysDictDataColumns holds the columns for the table hg_sys_dict_data. +var sysDictDataColumns = SysDictDataColumns{ + Id: "id", + Label: "label", + Value: "value", + ValueType: "value_type", + Type: "type", + ListClass: "list_class", + IsDefault: "is_default", + Sort: "sort", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysDictDataDao creates and returns a new DAO object for table data access. +func NewSysDictDataDao(handlers ...gdb.ModelHandler) *SysDictDataDao { + return &SysDictDataDao{ + group: "default", + table: "hg_sys_dict_data", + columns: sysDictDataColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysDictDataDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysDictDataDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysDictDataDao) Columns() SysDictDataColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysDictDataDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysDictDataDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysDictDataDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_dict_type.go b/server/internal/dao/internal/sys_dict_type.go new file mode 100755 index 0000000..b0b05f7 --- /dev/null +++ b/server/internal/dao/internal/sys_dict_type.go @@ -0,0 +1,95 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysDictTypeDao is the data access object for the table hg_sys_dict_type. +type SysDictTypeDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysDictTypeColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysDictTypeColumns defines and stores column names for the table hg_sys_dict_type. +type SysDictTypeColumns struct { + Id string // 字典类型ID + Pid string // 父类字典类型ID + Name string // 字典类型名称 + Type string // 字典类型 + Sort string // 排序 + Remark string // 备注 + Status string // 字典类型状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysDictTypeColumns holds the columns for the table hg_sys_dict_type. +var sysDictTypeColumns = SysDictTypeColumns{ + Id: "id", + Pid: "pid", + Name: "name", + Type: "type", + Sort: "sort", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysDictTypeDao creates and returns a new DAO object for table data access. +func NewSysDictTypeDao(handlers ...gdb.ModelHandler) *SysDictTypeDao { + return &SysDictTypeDao{ + group: "default", + table: "hg_sys_dict_type", + columns: sysDictTypeColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysDictTypeDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysDictTypeDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysDictTypeDao) Columns() SysDictTypeColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysDictTypeDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysDictTypeDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysDictTypeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_ems_log.go b/server/internal/dao/internal/sys_ems_log.go new file mode 100755 index 0000000..3cac58d --- /dev/null +++ b/server/internal/dao/internal/sys_ems_log.go @@ -0,0 +1,97 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysEmsLogDao is the data access object for the table hg_sys_ems_log. +type SysEmsLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysEmsLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysEmsLogColumns defines and stores column names for the table hg_sys_ems_log. +type SysEmsLogColumns struct { + Id string // 主键 + Event string // 事件 + Email string // 邮箱地址,多个用;隔开 + Code string // 验证码 + Times string // 验证次数 + Content string // 邮件内容 + Ip string // ip地址 + Status string // 状态(1未验证,2已验证) + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysEmsLogColumns holds the columns for the table hg_sys_ems_log. +var sysEmsLogColumns = SysEmsLogColumns{ + Id: "id", + Event: "event", + Email: "email", + Code: "code", + Times: "times", + Content: "content", + Ip: "ip", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysEmsLogDao creates and returns a new DAO object for table data access. +func NewSysEmsLogDao(handlers ...gdb.ModelHandler) *SysEmsLogDao { + return &SysEmsLogDao{ + group: "default", + table: "hg_sys_ems_log", + columns: sysEmsLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysEmsLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysEmsLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysEmsLogDao) Columns() SysEmsLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysEmsLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysEmsLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysEmsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_gen_codes.go b/server/internal/dao/internal/sys_gen_codes.go new file mode 100755 index 0000000..e909a3f --- /dev/null +++ b/server/internal/dao/internal/sys_gen_codes.go @@ -0,0 +1,105 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysGenCodesDao is the data access object for the table hg_sys_gen_codes. +type SysGenCodesDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysGenCodesColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysGenCodesColumns defines and stores column names for the table hg_sys_gen_codes. +type SysGenCodesColumns struct { + Id string // 生成ID + GenType string // 生成类型 + GenTemplate string // 生成模板 + VarName string // 实体命名 + Options string // 配置选项 + DbName string // 数据库名称 + TableName string // 主表名称 + TableComment string // 主表注释 + DaoName string // 主表dao模型 + MasterColumns string // 主表字段 + AddonName string // 插件名称 + Status string // 生成状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysGenCodesColumns holds the columns for the table hg_sys_gen_codes. +var sysGenCodesColumns = SysGenCodesColumns{ + Id: "id", + GenType: "gen_type", + GenTemplate: "gen_template", + VarName: "var_name", + Options: "options", + DbName: "db_name", + TableName: "table_name", + TableComment: "table_comment", + DaoName: "dao_name", + MasterColumns: "master_columns", + AddonName: "addon_name", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysGenCodesDao creates and returns a new DAO object for table data access. +func NewSysGenCodesDao(handlers ...gdb.ModelHandler) *SysGenCodesDao { + return &SysGenCodesDao{ + group: "default", + table: "hg_sys_gen_codes", + columns: sysGenCodesColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysGenCodesDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysGenCodesDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysGenCodesDao) Columns() SysGenCodesColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysGenCodesDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysGenCodesDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysGenCodesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_gen_curd_demo.go b/server/internal/dao/internal/sys_gen_curd_demo.go new file mode 100755 index 0000000..25bd694 --- /dev/null +++ b/server/internal/dao/internal/sys_gen_curd_demo.go @@ -0,0 +1,111 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysGenCurdDemoDao is the data access object for the table hg_sys_gen_curd_demo. +type SysGenCurdDemoDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysGenCurdDemoColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysGenCurdDemoColumns defines and stores column names for the table hg_sys_gen_curd_demo. +type SysGenCurdDemoColumns struct { + Id string // ID + CategoryId string // 分类ID + Title string // 标题 + Description string // 描述 + Content string // 内容 + Image string // 单图 + Attachfile string // 附件 + CityId string // 所在城市 + Switch string // 显示开关 + Sort string // 排序 + Status string // 状态 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 + DeletedAt string // 删除时间 +} + +// sysGenCurdDemoColumns holds the columns for the table hg_sys_gen_curd_demo. +var sysGenCurdDemoColumns = SysGenCurdDemoColumns{ + Id: "id", + CategoryId: "category_id", + Title: "title", + Description: "description", + Content: "content", + Image: "image", + Attachfile: "attachfile", + CityId: "city_id", + Switch: "switch", + Sort: "sort", + Status: "status", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewSysGenCurdDemoDao creates and returns a new DAO object for table data access. +func NewSysGenCurdDemoDao(handlers ...gdb.ModelHandler) *SysGenCurdDemoDao { + return &SysGenCurdDemoDao{ + group: "default", + table: "hg_sys_gen_curd_demo", + columns: sysGenCurdDemoColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysGenCurdDemoDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysGenCurdDemoDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysGenCurdDemoDao) Columns() SysGenCurdDemoColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysGenCurdDemoDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysGenCurdDemoDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysGenCurdDemoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_gen_tree_demo.go b/server/internal/dao/internal/sys_gen_tree_demo.go new file mode 100755 index 0000000..5e3cdc5 --- /dev/null +++ b/server/internal/dao/internal/sys_gen_tree_demo.go @@ -0,0 +1,105 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysGenTreeDemoDao is the data access object for the table hg_sys_gen_tree_demo. +type SysGenTreeDemoDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysGenTreeDemoColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysGenTreeDemoColumns defines and stores column names for the table hg_sys_gen_tree_demo. +type SysGenTreeDemoColumns struct { + Id string // ID + Pid string // 上级ID + Level string // 关系树级别 + Tree string // 关系树 + CategoryId string // 分类ID + Title string // 标题 + Description string // 描述 + Sort string // 排序 + Status string // 状态 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 + DeletedAt string // 删除时间 +} + +// sysGenTreeDemoColumns holds the columns for the table hg_sys_gen_tree_demo. +var sysGenTreeDemoColumns = SysGenTreeDemoColumns{ + Id: "id", + Pid: "pid", + Level: "level", + Tree: "tree", + CategoryId: "category_id", + Title: "title", + Description: "description", + Sort: "sort", + Status: "status", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewSysGenTreeDemoDao creates and returns a new DAO object for table data access. +func NewSysGenTreeDemoDao(handlers ...gdb.ModelHandler) *SysGenTreeDemoDao { + return &SysGenTreeDemoDao{ + group: "default", + table: "hg_sys_gen_tree_demo", + columns: sysGenTreeDemoColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysGenTreeDemoDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysGenTreeDemoDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysGenTreeDemoDao) Columns() SysGenTreeDemoColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysGenTreeDemoDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysGenTreeDemoDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysGenTreeDemoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_log.go b/server/internal/dao/internal/sys_log.go new file mode 100755 index 0000000..79813b3 --- /dev/null +++ b/server/internal/dao/internal/sys_log.go @@ -0,0 +1,123 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysLogDao is the data access object for the table hg_sys_log. +type SysLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysLogColumns defines and stores column names for the table hg_sys_log. +type SysLogColumns struct { + Id string // 日志ID + ReqId string // 对外ID + AppId string // 应用ID + MerchantId string // 商户ID + MemberId string // 用户ID + Method string // 提交类型 + Module string // 访问模块 + Url string // 提交url + GetData string // get数据 + PostData string // post数据 + HeaderData string // header数据 + Ip string // IP地址 + ProvinceId string // 省编码 + CityId string // 市编码 + ErrorCode string // 报错code + ErrorMsg string // 对外错误提示 + ErrorData string // 报错日志 + UserAgent string // UA信息 + TakeUpTime string // 请求耗时 + Timestamp string // 响应时间 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// sysLogColumns holds the columns for the table hg_sys_log. +var sysLogColumns = SysLogColumns{ + Id: "id", + ReqId: "req_id", + AppId: "app_id", + MerchantId: "merchant_id", + MemberId: "member_id", + Method: "method", + Module: "module", + Url: "url", + GetData: "get_data", + PostData: "post_data", + HeaderData: "header_data", + Ip: "ip", + ProvinceId: "province_id", + CityId: "city_id", + ErrorCode: "error_code", + ErrorMsg: "error_msg", + ErrorData: "error_data", + UserAgent: "user_agent", + TakeUpTime: "take_up_time", + Timestamp: "timestamp", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysLogDao creates and returns a new DAO object for table data access. +func NewSysLogDao(handlers ...gdb.ModelHandler) *SysLogDao { + return &SysLogDao{ + group: "default", + table: "hg_sys_log", + columns: sysLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysLogDao) Columns() SysLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_login_log.go b/server/internal/dao/internal/sys_login_log.go new file mode 100755 index 0000000..0637049 --- /dev/null +++ b/server/internal/dao/internal/sys_login_log.go @@ -0,0 +1,105 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysLoginLogDao is the data access object for the table hg_sys_login_log. +type SysLoginLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysLoginLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysLoginLogColumns defines and stores column names for the table hg_sys_login_log. +type SysLoginLogColumns struct { + Id string // 日志ID + ReqId string // 请求ID + MemberId string // 用户ID + Username string // 用户名 + Response string // 响应数据 + LoginAt string // 登录时间 + LoginIp string // 登录IP + ProvinceId string // 省编码 + CityId string // 市编码 + UserAgent string // UA信息 + ErrMsg string // 错误提示 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// sysLoginLogColumns holds the columns for the table hg_sys_login_log. +var sysLoginLogColumns = SysLoginLogColumns{ + Id: "id", + ReqId: "req_id", + MemberId: "member_id", + Username: "username", + Response: "response", + LoginAt: "login_at", + LoginIp: "login_ip", + ProvinceId: "province_id", + CityId: "city_id", + UserAgent: "user_agent", + ErrMsg: "err_msg", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysLoginLogDao creates and returns a new DAO object for table data access. +func NewSysLoginLogDao(handlers ...gdb.ModelHandler) *SysLoginLogDao { + return &SysLoginLogDao{ + group: "default", + table: "hg_sys_login_log", + columns: sysLoginLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysLoginLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysLoginLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysLoginLogDao) Columns() SysLoginLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysLoginLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysLoginLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysLoginLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_provinces.go b/server/internal/dao/internal/sys_provinces.go new file mode 100755 index 0000000..66f4f53 --- /dev/null +++ b/server/internal/dao/internal/sys_provinces.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysProvincesDao is the data access object for the table hg_sys_provinces. +type SysProvincesDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysProvincesColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysProvincesColumns defines and stores column names for the table hg_sys_provinces. +type SysProvincesColumns struct { + Id string // 省市区ID + Title string // 栏目名称 + Pinyin string // 拼音 + Lng string // 经度 + Lat string // 纬度 + Pid string // 父栏目 + Level string // 关系树等级 + Tree string // 关系树 + Sort string // 排序 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysProvincesColumns holds the columns for the table hg_sys_provinces. +var sysProvincesColumns = SysProvincesColumns{ + Id: "id", + Title: "title", + Pinyin: "pinyin", + Lng: "lng", + Lat: "lat", + Pid: "pid", + Level: "level", + Tree: "tree", + Sort: "sort", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysProvincesDao creates and returns a new DAO object for table data access. +func NewSysProvincesDao(handlers ...gdb.ModelHandler) *SysProvincesDao { + return &SysProvincesDao{ + group: "default", + table: "hg_sys_provinces", + columns: sysProvincesColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysProvincesDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysProvincesDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysProvincesDao) Columns() SysProvincesColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysProvincesDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysProvincesDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysProvincesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_serve_license.go b/server/internal/dao/internal/sys_serve_license.go new file mode 100755 index 0000000..46ef2f5 --- /dev/null +++ b/server/internal/dao/internal/sys_serve_license.go @@ -0,0 +1,111 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysServeLicenseDao is the data access object for the table hg_sys_serve_license. +type SysServeLicenseDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysServeLicenseColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysServeLicenseColumns defines and stores column names for the table hg_sys_serve_license. +type SysServeLicenseColumns struct { + Id string // 许可ID + Group string // 分组 + Name string // 许可名称 + Appid string // 应用ID + SecretKey string // 应用秘钥 + RemoteAddr string // 最后连接地址 + OnlineLimit string // 在线限制 + LoginTimes string // 登录次数 + LastLoginAt string // 最后登录时间 + LastActiveAt string // 最后心跳 + Routes string // 路由表,空使用默认分组路由 + AllowedIps string // IP白名单 + EndAt string // 授权有效期 + Remark string // 备注 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// sysServeLicenseColumns holds the columns for the table hg_sys_serve_license. +var sysServeLicenseColumns = SysServeLicenseColumns{ + Id: "id", + Group: "group", + Name: "name", + Appid: "appid", + SecretKey: "secret_key", + RemoteAddr: "remote_addr", + OnlineLimit: "online_limit", + LoginTimes: "login_times", + LastLoginAt: "last_login_at", + LastActiveAt: "last_active_at", + Routes: "routes", + AllowedIps: "allowed_ips", + EndAt: "end_at", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysServeLicenseDao creates and returns a new DAO object for table data access. +func NewSysServeLicenseDao(handlers ...gdb.ModelHandler) *SysServeLicenseDao { + return &SysServeLicenseDao{ + group: "default", + table: "hg_sys_serve_license", + columns: sysServeLicenseColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysServeLicenseDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysServeLicenseDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysServeLicenseDao) Columns() SysServeLicenseColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysServeLicenseDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysServeLicenseDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysServeLicenseDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_serve_log.go b/server/internal/dao/internal/sys_serve_log.go new file mode 100755 index 0000000..abf52f9 --- /dev/null +++ b/server/internal/dao/internal/sys_serve_log.go @@ -0,0 +1,97 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysServeLogDao is the data access object for the table hg_sys_serve_log. +type SysServeLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysServeLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysServeLogColumns defines and stores column names for the table hg_sys_serve_log. +type SysServeLogColumns struct { + Id string // 日志ID + TraceId string // 链路ID + LevelFormat string // 日志级别 + Content string // 日志内容 + Stack string // 打印堆栈 + Line string // 调用行 + TriggerNs string // 触发时间(ns) + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 +} + +// sysServeLogColumns holds the columns for the table hg_sys_serve_log. +var sysServeLogColumns = SysServeLogColumns{ + Id: "id", + TraceId: "trace_id", + LevelFormat: "level_format", + Content: "content", + Stack: "stack", + Line: "line", + TriggerNs: "trigger_ns", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysServeLogDao creates and returns a new DAO object for table data access. +func NewSysServeLogDao(handlers ...gdb.ModelHandler) *SysServeLogDao { + return &SysServeLogDao{ + group: "default", + table: "hg_sys_serve_log", + columns: sysServeLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysServeLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysServeLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysServeLogDao) Columns() SysServeLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysServeLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysServeLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysServeLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/sys_sms_log.go b/server/internal/dao/internal/sys_sms_log.go new file mode 100755 index 0000000..da73d87 --- /dev/null +++ b/server/internal/dao/internal/sys_sms_log.go @@ -0,0 +1,95 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// SysSmsLogDao is the data access object for the table hg_sys_sms_log. +type SysSmsLogDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns SysSmsLogColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// SysSmsLogColumns defines and stores column names for the table hg_sys_sms_log. +type SysSmsLogColumns struct { + Id string // 主键 + Event string // 事件 + Mobile string // 手机号 + Code string // 验证码或短信内容 + Times string // 验证次数 + Ip string // ip地址 + Status string // 状态(1未验证,2已验证) + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// sysSmsLogColumns holds the columns for the table hg_sys_sms_log. +var sysSmsLogColumns = SysSmsLogColumns{ + Id: "id", + Event: "event", + Mobile: "mobile", + Code: "code", + Times: "times", + Ip: "ip", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewSysSmsLogDao creates and returns a new DAO object for table data access. +func NewSysSmsLogDao(handlers ...gdb.ModelHandler) *SysSmsLogDao { + return &SysSmsLogDao{ + group: "default", + table: "hg_sys_sms_log", + columns: sysSmsLogColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *SysSmsLogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *SysSmsLogDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *SysSmsLogDao) Columns() SysSmsLogColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *SysSmsLogDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *SysSmsLogDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *SysSmsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/task.go b/server/internal/dao/internal/task.go new file mode 100644 index 0000000..e4611ad --- /dev/null +++ b/server/internal/dao/internal/task.go @@ -0,0 +1,127 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// TaskDao is the data access object for the table hg_task. +type TaskDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns TaskColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// TaskColumns defines and stores column names for the table hg_task. +type TaskColumns struct { + Id string // 主键 + TenantId string // 租户ID + TaskNo string // 任务编号 + HallId string // 任务大厅ID + Title string // 标题 + Description string // 描述 + DetailHtml string // 清洗后的任务详情 + CoverAttachmentId string // 封面附件ID + CoverUrl string // 封面地址 + CommissionAmount string // 固定佣金(分) + CommissionRate string // 佣金万分比 + DailyLimit string // 每日总量 + PerMemberLimit string // 单会员限制 + StartAt string // 开始时间 + EndAt string // 结束时间 + PublishStatus string // 发布状态 + Sort string // 排序 + Version string // 乐观锁 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// taskColumns holds the columns for the table hg_task. +var taskColumns = TaskColumns{ + Id: "id", + TenantId: "tenant_id", + TaskNo: "task_no", + HallId: "hall_id", + Title: "title", + Description: "description", + DetailHtml: "detail_html", + CoverAttachmentId: "cover_attachment_id", + CoverUrl: "cover_url", + CommissionAmount: "commission_amount", + CommissionRate: "commission_rate", + DailyLimit: "daily_limit", + PerMemberLimit: "per_member_limit", + StartAt: "start_at", + EndAt: "end_at", + PublishStatus: "publish_status", + Sort: "sort", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewTaskDao creates and returns a new DAO object for table data access. +func NewTaskDao(handlers ...gdb.ModelHandler) *TaskDao { + return &TaskDao{ + group: "default", + table: "hg_task", + columns: taskColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *TaskDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *TaskDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *TaskDao) Columns() TaskColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *TaskDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *TaskDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *TaskDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/task_hall.go b/server/internal/dao/internal/task_hall.go new file mode 100644 index 0000000..83d2674 --- /dev/null +++ b/server/internal/dao/internal/task_hall.go @@ -0,0 +1,117 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// TaskHallDao is the data access object for the table hg_task_hall. +type TaskHallDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns TaskHallColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// TaskHallColumns defines and stores column names for the table hg_task_hall. +type TaskHallColumns struct { + Id string // 主键 + TenantId string // 租户ID + HallCode string // 大厅编码 + Name string // 名称 + IconAttachmentId string // 图标附件ID + IconUrl string // 图标URL + Summary string // 简介 + CommissionRate string // 佣金万分比 + RateUnit string // 比例单位 + ClientRoute string // C端跳转 + PublishStatus string // 发布状态 + Sort string // 排序 + Version string // 乐观锁 + Remark string // 备注 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + DeletedBy string // 删除者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + DeletedAt string // 删除时间 +} + +// taskHallColumns holds the columns for the table hg_task_hall. +var taskHallColumns = TaskHallColumns{ + Id: "id", + TenantId: "tenant_id", + HallCode: "hall_code", + Name: "name", + IconAttachmentId: "icon_attachment_id", + IconUrl: "icon_url", + Summary: "summary", + CommissionRate: "commission_rate", + RateUnit: "rate_unit", + ClientRoute: "client_route", + PublishStatus: "publish_status", + Sort: "sort", + Version: "version", + Remark: "remark", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + DeletedBy: "deleted_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewTaskHallDao creates and returns a new DAO object for table data access. +func NewTaskHallDao(handlers ...gdb.ModelHandler) *TaskHallDao { + return &TaskHallDao{ + group: "default", + table: "hg_task_hall", + columns: taskHallColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *TaskHallDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *TaskHallDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *TaskHallDao) Columns() TaskHallColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *TaskHallDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *TaskHallDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *TaskHallDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/task_hall_level.go b/server/internal/dao/internal/task_hall_level.go new file mode 100644 index 0000000..1df7a84 --- /dev/null +++ b/server/internal/dao/internal/task_hall_level.go @@ -0,0 +1,87 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// TaskHallLevelDao is the data access object for the table hg_task_hall_level. +type TaskHallLevelDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns TaskHallLevelColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// TaskHallLevelColumns defines and stores column names for the table hg_task_hall_level. +type TaskHallLevelColumns struct { + Id string // 主键 + TenantId string // 租户ID + HallId string // 任务大厅ID + LevelId string // 会员等级ID + CreatedAt string // 创建时间 +} + +// taskHallLevelColumns holds the columns for the table hg_task_hall_level. +var taskHallLevelColumns = TaskHallLevelColumns{ + Id: "id", + TenantId: "tenant_id", + HallId: "hall_id", + LevelId: "level_id", + CreatedAt: "created_at", +} + +// NewTaskHallLevelDao creates and returns a new DAO object for table data access. +func NewTaskHallLevelDao(handlers ...gdb.ModelHandler) *TaskHallLevelDao { + return &TaskHallLevelDao{ + group: "default", + table: "hg_task_hall_level", + columns: taskHallLevelColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *TaskHallLevelDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *TaskHallLevelDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *TaskHallLevelDao) Columns() TaskHallLevelColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *TaskHallLevelDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *TaskHallLevelDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *TaskHallLevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/task_level.go b/server/internal/dao/internal/task_level.go new file mode 100644 index 0000000..de06484 --- /dev/null +++ b/server/internal/dao/internal/task_level.go @@ -0,0 +1,87 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// TaskLevelDao is the data access object for the table hg_task_level. +type TaskLevelDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns TaskLevelColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// TaskLevelColumns defines and stores column names for the table hg_task_level. +type TaskLevelColumns struct { + Id string // 主键 + TenantId string // 租户ID + TaskId string // 任务ID + LevelId string // 会员等级ID + CreatedAt string // 创建时间 +} + +// taskLevelColumns holds the columns for the table hg_task_level. +var taskLevelColumns = TaskLevelColumns{ + Id: "id", + TenantId: "tenant_id", + TaskId: "task_id", + LevelId: "level_id", + CreatedAt: "created_at", +} + +// NewTaskLevelDao creates and returns a new DAO object for table data access. +func NewTaskLevelDao(handlers ...gdb.ModelHandler) *TaskLevelDao { + return &TaskLevelDao{ + group: "default", + table: "hg_task_level", + columns: taskLevelColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *TaskLevelDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *TaskLevelDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *TaskLevelDao) Columns() TaskLevelColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *TaskLevelDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *TaskLevelDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *TaskLevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/task_submission.go b/server/internal/dao/internal/task_submission.go new file mode 100644 index 0000000..6a5ee2d --- /dev/null +++ b/server/internal/dao/internal/task_submission.go @@ -0,0 +1,125 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// TaskSubmissionDao is the data access object for the table hg_task_submission. +type TaskSubmissionDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns TaskSubmissionColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// TaskSubmissionColumns defines and stores column names for the table hg_task_submission. +type TaskSubmissionColumns struct { + Id string // 主键 + TenantId string // 租户ID + SubmissionNo string // 提交编号 + TradeOrderId string // 交易订单ID + TaskId string // 任务ID + MemberId string // 会员ID + MemberLevelId string // 提交时等级ID + EvidenceText string // 证据说明 + EvidenceAttachmentIds string // 证据附件 + SubmissionStatus string // 1待审 2通过 3驳回 4已结算 5已冲正 + CommissionAmount string // 佣金快照(分) + SuccessRate string // 成功率万分比 + ReviewedBy string // 审核人 + ReviewedAt string // 审核时间 + ReviewReasonCode string // 标准原因 + ReviewReason string // 审核意见 + AllowResubmit string // 是否允许重提 + LedgerId string // 佣金台账ID + SettledAt string // 结算时间 + ReversalApprovalId string // 冲正审批ID + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// taskSubmissionColumns holds the columns for the table hg_task_submission. +var taskSubmissionColumns = TaskSubmissionColumns{ + Id: "id", + TenantId: "tenant_id", + SubmissionNo: "submission_no", + TradeOrderId: "trade_order_id", + TaskId: "task_id", + MemberId: "member_id", + MemberLevelId: "member_level_id", + EvidenceText: "evidence_text", + EvidenceAttachmentIds: "evidence_attachment_ids", + SubmissionStatus: "submission_status", + CommissionAmount: "commission_amount", + SuccessRate: "success_rate", + ReviewedBy: "reviewed_by", + ReviewedAt: "reviewed_at", + ReviewReasonCode: "review_reason_code", + ReviewReason: "review_reason", + AllowResubmit: "allow_resubmit", + LedgerId: "ledger_id", + SettledAt: "settled_at", + ReversalApprovalId: "reversal_approval_id", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewTaskSubmissionDao creates and returns a new DAO object for table data access. +func NewTaskSubmissionDao(handlers ...gdb.ModelHandler) *TaskSubmissionDao { + return &TaskSubmissionDao{ + group: "default", + table: "hg_task_submission", + columns: taskSubmissionColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *TaskSubmissionDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *TaskSubmissionDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *TaskSubmissionDao) Columns() TaskSubmissionColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *TaskSubmissionDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *TaskSubmissionDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *TaskSubmissionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/test_category.go b/server/internal/dao/internal/test_category.go new file mode 100755 index 0000000..1ebbc81 --- /dev/null +++ b/server/internal/dao/internal/test_category.go @@ -0,0 +1,97 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// TestCategoryDao is the data access object for the table hg_test_category. +type TestCategoryDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns TestCategoryColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// TestCategoryColumns defines and stores column names for the table hg_test_category. +type TestCategoryColumns struct { + Id string // 分类ID + Name string // 分类名称 + ShortName string // 简称 + Description string // 描述 + Sort string // 排序 + Remark string // 备注 + Status string // 状态 + CreatedAt string // 创建时间 + UpdatedAt string // 修改时间 + DeletedAt string // 删除时间 +} + +// testCategoryColumns holds the columns for the table hg_test_category. +var testCategoryColumns = TestCategoryColumns{ + Id: "id", + Name: "name", + ShortName: "short_name", + Description: "description", + Sort: "sort", + Remark: "remark", + Status: "status", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewTestCategoryDao creates and returns a new DAO object for table data access. +func NewTestCategoryDao(handlers ...gdb.ModelHandler) *TestCategoryDao { + return &TestCategoryDao{ + group: "default", + table: "hg_test_category", + columns: testCategoryColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *TestCategoryDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *TestCategoryDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *TestCategoryDao) Columns() TestCategoryColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *TestCategoryDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *TestCategoryDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *TestCategoryDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/trade_order.go b/server/internal/dao/internal/trade_order.go new file mode 100644 index 0000000..23bab33 --- /dev/null +++ b/server/internal/dao/internal/trade_order.go @@ -0,0 +1,129 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// TradeOrderDao is the data access object for the table hg_trade_order. +type TradeOrderDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns TradeOrderColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// TradeOrderColumns defines and stores column names for the table hg_trade_order. +type TradeOrderColumns struct { + Id string // 主键 + TenantId string // 租户ID + OrderNo string // 订单号 + MemberId string // 会员ID + TaskId string // 任务ID + ProductId string // 商品ID + ProductName string // 商品名称快照 + OrderType string // 订单类型 + Quantity string // 数量 + UnitPriceAmount string // 单价(分) + TotalAmount string // 订单金额(分) + CommissionAmount string // 佣金(分) + Currency string // 币种 + MemberLevelId string // 下单等级ID + RuleSnapshot string // 规则快照 + Message string // 订单消息 + OrderStatus string // 订单状态 + FreezeStatus string // 冻结状态 + ApprovalRequestId string // 人工处理审批ID + MatchedAt string // 匹配时间 + CompletedAt string // 完成时间 + UnfrozenAt string // 解冻时间 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 下单时间 + UpdatedAt string // 更新时间 +} + +// tradeOrderColumns holds the columns for the table hg_trade_order. +var tradeOrderColumns = TradeOrderColumns{ + Id: "id", + TenantId: "tenant_id", + OrderNo: "order_no", + MemberId: "member_id", + TaskId: "task_id", + ProductId: "product_id", + ProductName: "product_name", + OrderType: "order_type", + Quantity: "quantity", + UnitPriceAmount: "unit_price_amount", + TotalAmount: "total_amount", + CommissionAmount: "commission_amount", + Currency: "currency", + MemberLevelId: "member_level_id", + RuleSnapshot: "rule_snapshot", + Message: "message", + OrderStatus: "order_status", + FreezeStatus: "freeze_status", + ApprovalRequestId: "approval_request_id", + MatchedAt: "matched_at", + CompletedAt: "completed_at", + UnfrozenAt: "unfrozen_at", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewTradeOrderDao creates and returns a new DAO object for table data access. +func NewTradeOrderDao(handlers ...gdb.ModelHandler) *TradeOrderDao { + return &TradeOrderDao{ + group: "default", + table: "hg_trade_order", + columns: tradeOrderColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *TradeOrderDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *TradeOrderDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *TradeOrderDao) Columns() TradeOrderColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *TradeOrderDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *TradeOrderDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *TradeOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/wallet_account.go b/server/internal/dao/internal/wallet_account.go new file mode 100644 index 0000000..bd5c0a6 --- /dev/null +++ b/server/internal/dao/internal/wallet_account.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// WalletAccountDao is the data access object for the table hg_wallet_account. +type WalletAccountDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns WalletAccountColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// WalletAccountColumns defines and stores column names for the table hg_wallet_account. +type WalletAccountColumns struct { + Id string // 主键 + TenantId string // 租户ID + MemberId string // 会员ID + Currency string // 币种 + AvailableAmount string // 可用金额(分) + FrozenAmount string // 冻结金额(分) + TotalIncome string // 累计收入(分) + TotalExpense string // 累计支出(分) + AccountStatus string // 账户状态 + Version string // 乐观锁 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// walletAccountColumns holds the columns for the table hg_wallet_account. +var walletAccountColumns = WalletAccountColumns{ + Id: "id", + TenantId: "tenant_id", + MemberId: "member_id", + Currency: "currency", + AvailableAmount: "available_amount", + FrozenAmount: "frozen_amount", + TotalIncome: "total_income", + TotalExpense: "total_expense", + AccountStatus: "account_status", + Version: "version", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewWalletAccountDao creates and returns a new DAO object for table data access. +func NewWalletAccountDao(handlers ...gdb.ModelHandler) *WalletAccountDao { + return &WalletAccountDao{ + group: "default", + table: "hg_wallet_account", + columns: walletAccountColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *WalletAccountDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *WalletAccountDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *WalletAccountDao) Columns() WalletAccountColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *WalletAccountDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *WalletAccountDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *WalletAccountDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/wallet_adjustment_request.go b/server/internal/dao/internal/wallet_adjustment_request.go new file mode 100644 index 0000000..e8202ba --- /dev/null +++ b/server/internal/dao/internal/wallet_adjustment_request.go @@ -0,0 +1,115 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// WalletAdjustmentRequestDao is the data access object for the table hg_wallet_adjustment_request. +type WalletAdjustmentRequestDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns WalletAdjustmentRequestColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// WalletAdjustmentRequestColumns defines and stores column names for the table hg_wallet_adjustment_request. +type WalletAdjustmentRequestColumns struct { + Id string // 主键 + TenantId string // 租户ID + RequestNo string // 申请单号 + MemberId string // 会员ID + AccountId string // 钱包账户ID + AdjustType string // 调整类型 + Direction string // 方向 1收入 2支出 + Amount string // 金额(分) + ReasonCode string // 原因编码 + ReasonText string // 原因说明 + EvidenceJson string // 凭证附件 + IdempotencyKey string // 幂等键 + RequestStatus string // 状态 1待审批 2已通过 3已拒绝 4已执行 + ApprovalRequestId string // 审批单ID + LedgerId string // 账变流水ID + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// walletAdjustmentRequestColumns holds the columns for the table hg_wallet_adjustment_request. +var walletAdjustmentRequestColumns = WalletAdjustmentRequestColumns{ + Id: "id", + TenantId: "tenant_id", + RequestNo: "request_no", + MemberId: "member_id", + AccountId: "account_id", + AdjustType: "adjust_type", + Direction: "direction", + Amount: "amount", + ReasonCode: "reason_code", + ReasonText: "reason_text", + EvidenceJson: "evidence_json", + IdempotencyKey: "idempotency_key", + RequestStatus: "request_status", + ApprovalRequestId: "approval_request_id", + LedgerId: "ledger_id", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewWalletAdjustmentRequestDao creates and returns a new DAO object for table data access. +func NewWalletAdjustmentRequestDao(handlers ...gdb.ModelHandler) *WalletAdjustmentRequestDao { + return &WalletAdjustmentRequestDao{ + group: "default", + table: "hg_wallet_adjustment_request", + columns: walletAdjustmentRequestColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *WalletAdjustmentRequestDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *WalletAdjustmentRequestDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *WalletAdjustmentRequestDao) Columns() WalletAdjustmentRequestColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *WalletAdjustmentRequestDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *WalletAdjustmentRequestDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *WalletAdjustmentRequestDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/wallet_ledger.go b/server/internal/dao/internal/wallet_ledger.go new file mode 100644 index 0000000..1673f8a --- /dev/null +++ b/server/internal/dao/internal/wallet_ledger.go @@ -0,0 +1,115 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// WalletLedgerDao is the data access object for the table hg_wallet_ledger. +type WalletLedgerDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns WalletLedgerColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// WalletLedgerColumns defines and stores column names for the table hg_wallet_ledger. +type WalletLedgerColumns struct { + Id string // 主键 + TenantId string // 租户ID + LedgerNo string // 账变流水号 + AccountId string // 钱包账户ID + MemberId string // 会员ID + BizType string // 业务类型 + BizNo string // 业务单号 + EntryType string // 账变类型 + Direction string // 方向 1收入 2支出 + Amount string // 发生金额(分) + BeforeAmount string // 变更前余额(分) + AfterAmount string // 变更后余额(分) + Currency string // 币种 + ReversalOf string // 冲正原流水ID + IdempotencyKey string // 幂等键 + Remark string // 说明 + OperatorId string // 操作人 + OccurredAt string // 发生时间 + CreatedAt string // 创建时间 +} + +// walletLedgerColumns holds the columns for the table hg_wallet_ledger. +var walletLedgerColumns = WalletLedgerColumns{ + Id: "id", + TenantId: "tenant_id", + LedgerNo: "ledger_no", + AccountId: "account_id", + MemberId: "member_id", + BizType: "biz_type", + BizNo: "biz_no", + EntryType: "entry_type", + Direction: "direction", + Amount: "amount", + BeforeAmount: "before_amount", + AfterAmount: "after_amount", + Currency: "currency", + ReversalOf: "reversal_of", + IdempotencyKey: "idempotency_key", + Remark: "remark", + OperatorId: "operator_id", + OccurredAt: "occurred_at", + CreatedAt: "created_at", +} + +// NewWalletLedgerDao creates and returns a new DAO object for table data access. +func NewWalletLedgerDao(handlers ...gdb.ModelHandler) *WalletLedgerDao { + return &WalletLedgerDao{ + group: "default", + table: "hg_wallet_ledger", + columns: walletLedgerColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *WalletLedgerDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *WalletLedgerDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *WalletLedgerDao) Columns() WalletLedgerColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *WalletLedgerDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *WalletLedgerDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *WalletLedgerDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/internal/withdrawal_order.go b/server/internal/dao/internal/withdrawal_order.go new file mode 100644 index 0000000..648e1f4 --- /dev/null +++ b/server/internal/dao/internal/withdrawal_order.go @@ -0,0 +1,135 @@ +// ========================================================================== +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ========================================================================== + +package internal + +import ( + "context" + + "github.com/gogf/gf/v2/database/gdb" + "github.com/gogf/gf/v2/frame/g" +) + +// WithdrawalOrderDao is the data access object for the table hg_withdrawal_order. +type WithdrawalOrderDao struct { + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of the current DAO. + columns WithdrawalOrderColumns // columns contains all the column names of Table for convenient usage. + handlers []gdb.ModelHandler // handlers for customized model modification. +} + +// WithdrawalOrderColumns defines and stores column names for the table hg_withdrawal_order. +type WithdrawalOrderColumns struct { + Id string // 主键 + TenantId string // 租户ID + WithdrawalNo string // 提现单号 + MemberId string // 会员ID + PaymentAccountId string // 收款账户ID + ChannelId string // 付款渠道ID + RequestAmount string // 申请金额(分) + FeeAmount string // 手续费(分) + ActualAmount string // 实际到账(分) + Currency string // 币种 + AccountSnapshotCipher string // 收款账户加密快照 + AccountMask string // 收款账户脱敏快照 + BankName string // 银行名称快照 + HolderMask string // 开户名脱敏快照 + RiskResult string // 风控结果摘要 + WithdrawalStatus string // 提现状态 + ReviewReasonCode string // 审核原因编码 + ReviewReason string // 审核意见 + ApprovalRequestId string // 审批单ID + ExternalNo string // 外部付款单号 + FreezeLedgerId string // 冻结台账ID + FinalLedgerId string // 完成或解冻台账ID + ReviewedAt string // 审核时间 + ProcessedAt string // 处理时间 + CompletedAt string // 完成时间 + CreatedBy string // 创建者 + UpdatedBy string // 更新者 + CreatedAt string // 发起时间 + UpdatedAt string // 更新时间 +} + +// withdrawalOrderColumns holds the columns for the table hg_withdrawal_order. +var withdrawalOrderColumns = WithdrawalOrderColumns{ + Id: "id", + TenantId: "tenant_id", + WithdrawalNo: "withdrawal_no", + MemberId: "member_id", + PaymentAccountId: "payment_account_id", + ChannelId: "channel_id", + RequestAmount: "request_amount", + FeeAmount: "fee_amount", + ActualAmount: "actual_amount", + Currency: "currency", + AccountSnapshotCipher: "account_snapshot_cipher", + AccountMask: "account_mask", + BankName: "bank_name", + HolderMask: "holder_mask", + RiskResult: "risk_result", + WithdrawalStatus: "withdrawal_status", + ReviewReasonCode: "review_reason_code", + ReviewReason: "review_reason", + ApprovalRequestId: "approval_request_id", + ExternalNo: "external_no", + FreezeLedgerId: "freeze_ledger_id", + FinalLedgerId: "final_ledger_id", + ReviewedAt: "reviewed_at", + ProcessedAt: "processed_at", + CompletedAt: "completed_at", + CreatedBy: "created_by", + UpdatedBy: "updated_by", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewWithdrawalOrderDao creates and returns a new DAO object for table data access. +func NewWithdrawalOrderDao(handlers ...gdb.ModelHandler) *WithdrawalOrderDao { + return &WithdrawalOrderDao{ + group: "default", + table: "hg_withdrawal_order", + columns: withdrawalOrderColumns, + handlers: handlers, + } +} + +// DB retrieves and returns the underlying raw database management object of the current DAO. +func (dao *WithdrawalOrderDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of the current DAO. +func (dao *WithdrawalOrderDao) Table() string { + return dao.table +} + +// Columns returns all column names of the current DAO. +func (dao *WithdrawalOrderDao) Columns() WithdrawalOrderColumns { + return dao.columns +} + +// Group returns the database configuration group name of the current DAO. +func (dao *WithdrawalOrderDao) Group() string { + return dao.group +} + +// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +func (dao *WithdrawalOrderDao) Ctx(ctx context.Context) *gdb.Model { + model := dao.DB().Model(dao.table) + for _, handler := range dao.handlers { + model = handler(model) + } + return model.Safe().Ctx(ctx) +} + +// Transaction wraps the transaction logic using function f. +// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It commits the transaction and returns nil if function f returns nil. +// +// Note: Do not commit or roll back the transaction in function f, +// as it is automatically handled by this function. +func (dao *WithdrawalOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/server/internal/dao/outbox_event.go b/server/internal/dao/outbox_event.go new file mode 100644 index 0000000..f880b6b --- /dev/null +++ b/server/internal/dao/outbox_event.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// outboxEventDao is the data access object for the table hg_outbox_event. +// You can define custom methods on it to extend its functionality as needed. +type outboxEventDao struct { + *internal.OutboxEventDao +} + +var ( + // OutboxEvent is a globally accessible object for table hg_outbox_event operations. + OutboxEvent = outboxEventDao{internal.NewOutboxEventDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/pay_log.go b/server/internal/dao/pay_log.go new file mode 100755 index 0000000..eef43f9 --- /dev/null +++ b/server/internal/dao/pay_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// payLogDao is the data access object for the table hg_pay_log. +// You can define custom methods on it to extend its functionality as needed. +type payLogDao struct { + *internal.PayLogDao +} + +var ( + // PayLog is a globally accessible object for table hg_pay_log operations. + PayLog = payLogDao{internal.NewPayLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/pay_refund.go b/server/internal/dao/pay_refund.go new file mode 100755 index 0000000..bc52795 --- /dev/null +++ b/server/internal/dao/pay_refund.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// payRefundDao is the data access object for the table hg_pay_refund. +// You can define custom methods on it to extend its functionality as needed. +type payRefundDao struct { + *internal.PayRefundDao +} + +var ( + // PayRefund is a globally accessible object for table hg_pay_refund operations. + PayRefund = payRefundDao{internal.NewPayRefundDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/payment_channel.go b/server/internal/dao/payment_channel.go new file mode 100644 index 0000000..28257f7 --- /dev/null +++ b/server/internal/dao/payment_channel.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// paymentChannelDao is the data access object for the table hg_payment_channel. +// You can define custom methods on it to extend its functionality as needed. +type paymentChannelDao struct { + *internal.PaymentChannelDao +} + +var ( + // PaymentChannel is a globally accessible object for table hg_payment_channel operations. + PaymentChannel = paymentChannelDao{internal.NewPaymentChannelDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/product.go b/server/internal/dao/product.go new file mode 100644 index 0000000..b4bf4c5 --- /dev/null +++ b/server/internal/dao/product.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// productDao is the data access object for the table hg_product. +// You can define custom methods on it to extend its functionality as needed. +type productDao struct { + *internal.ProductDao +} + +var ( + // Product is a globally accessible object for table hg_product operations. + Product = productDao{internal.NewProductDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/product_category.go b/server/internal/dao/product_category.go new file mode 100644 index 0000000..eea4d26 --- /dev/null +++ b/server/internal/dao/product_category.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// productCategoryDao is the data access object for the table hg_product_category. +// You can define custom methods on it to extend its functionality as needed. +type productCategoryDao struct { + *internal.ProductCategoryDao +} + +var ( + // ProductCategory is a globally accessible object for table hg_product_category operations. + ProductCategory = productCategoryDao{internal.NewProductCategoryDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/recharge_order.go b/server/internal/dao/recharge_order.go new file mode 100644 index 0000000..fdd09a8 --- /dev/null +++ b/server/internal/dao/recharge_order.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// rechargeOrderDao is the data access object for the table hg_recharge_order. +// You can define custom methods on it to extend its functionality as needed. +type rechargeOrderDao struct { + *internal.RechargeOrderDao +} + +var ( + // RechargeOrder is a globally accessible object for table hg_recharge_order operations. + RechargeOrder = rechargeOrderDao{internal.NewRechargeOrderDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sensitive_access_log.go b/server/internal/dao/sensitive_access_log.go new file mode 100644 index 0000000..d92dfeb --- /dev/null +++ b/server/internal/dao/sensitive_access_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sensitiveAccessLogDao is the data access object for the table hg_sensitive_access_log. +// You can define custom methods on it to extend its functionality as needed. +type sensitiveAccessLogDao struct { + *internal.SensitiveAccessLogDao +} + +var ( + // SensitiveAccessLog is a globally accessible object for table hg_sensitive_access_log operations. + SensitiveAccessLog = sensitiveAccessLogDao{internal.NewSensitiveAccessLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/site_config_version.go b/server/internal/dao/site_config_version.go new file mode 100644 index 0000000..f64dcb4 --- /dev/null +++ b/server/internal/dao/site_config_version.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// siteConfigVersionDao is the data access object for the table hg_site_config_version. +// You can define custom methods on it to extend its functionality as needed. +type siteConfigVersionDao struct { + *internal.SiteConfigVersionDao +} + +var ( + // SiteConfigVersion is a globally accessible object for table hg_site_config_version operations. + SiteConfigVersion = siteConfigVersionDao{internal.NewSiteConfigVersionDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_addons_config.go b/server/internal/dao/sys_addons_config.go new file mode 100755 index 0000000..47c7893 --- /dev/null +++ b/server/internal/dao/sys_addons_config.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysAddonsConfigDao is the data access object for the table hg_sys_addons_config. +// You can define custom methods on it to extend its functionality as needed. +type sysAddonsConfigDao struct { + *internal.SysAddonsConfigDao +} + +var ( + // SysAddonsConfig is a globally accessible object for table hg_sys_addons_config operations. + SysAddonsConfig = sysAddonsConfigDao{internal.NewSysAddonsConfigDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_addons_install.go b/server/internal/dao/sys_addons_install.go new file mode 100644 index 0000000..3eb6bac --- /dev/null +++ b/server/internal/dao/sys_addons_install.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysAddonsInstallDao is the data access object for the table hg_sys_addons_install. +// You can define custom methods on it to extend its functionality as needed. +type sysAddonsInstallDao struct { + *internal.SysAddonsInstallDao +} + +var ( + // SysAddonsInstall is a globally accessible object for table hg_sys_addons_install operations. + SysAddonsInstall = sysAddonsInstallDao{internal.NewSysAddonsInstallDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_attachment.go b/server/internal/dao/sys_attachment.go new file mode 100755 index 0000000..2e40b56 --- /dev/null +++ b/server/internal/dao/sys_attachment.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysAttachmentDao is the data access object for the table hg_sys_attachment. +// You can define custom methods on it to extend its functionality as needed. +type sysAttachmentDao struct { + *internal.SysAttachmentDao +} + +var ( + // SysAttachment is a globally accessible object for table hg_sys_attachment operations. + SysAttachment = sysAttachmentDao{internal.NewSysAttachmentDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_blacklist.go b/server/internal/dao/sys_blacklist.go new file mode 100755 index 0000000..84bdec1 --- /dev/null +++ b/server/internal/dao/sys_blacklist.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysBlacklistDao is the data access object for the table hg_sys_blacklist. +// You can define custom methods on it to extend its functionality as needed. +type sysBlacklistDao struct { + *internal.SysBlacklistDao +} + +var ( + // SysBlacklist is a globally accessible object for table hg_sys_blacklist operations. + SysBlacklist = sysBlacklistDao{internal.NewSysBlacklistDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_config.go b/server/internal/dao/sys_config.go new file mode 100755 index 0000000..a868a27 --- /dev/null +++ b/server/internal/dao/sys_config.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysConfigDao is the data access object for the table hg_sys_config. +// You can define custom methods on it to extend its functionality as needed. +type sysConfigDao struct { + *internal.SysConfigDao +} + +var ( + // SysConfig is a globally accessible object for table hg_sys_config operations. + SysConfig = sysConfigDao{internal.NewSysConfigDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_cron.go b/server/internal/dao/sys_cron.go new file mode 100755 index 0000000..1e0f647 --- /dev/null +++ b/server/internal/dao/sys_cron.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysCronDao is the data access object for the table hg_sys_cron. +// You can define custom methods on it to extend its functionality as needed. +type sysCronDao struct { + *internal.SysCronDao +} + +var ( + // SysCron is a globally accessible object for table hg_sys_cron operations. + SysCron = sysCronDao{internal.NewSysCronDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_cron_group.go b/server/internal/dao/sys_cron_group.go new file mode 100755 index 0000000..25e1578 --- /dev/null +++ b/server/internal/dao/sys_cron_group.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysCronGroupDao is the data access object for the table hg_sys_cron_group. +// You can define custom methods on it to extend its functionality as needed. +type sysCronGroupDao struct { + *internal.SysCronGroupDao +} + +var ( + // SysCronGroup is a globally accessible object for table hg_sys_cron_group operations. + SysCronGroup = sysCronGroupDao{internal.NewSysCronGroupDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_dict_data.go b/server/internal/dao/sys_dict_data.go new file mode 100755 index 0000000..05e78a3 --- /dev/null +++ b/server/internal/dao/sys_dict_data.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysDictDataDao is the data access object for the table hg_sys_dict_data. +// You can define custom methods on it to extend its functionality as needed. +type sysDictDataDao struct { + *internal.SysDictDataDao +} + +var ( + // SysDictData is a globally accessible object for table hg_sys_dict_data operations. + SysDictData = sysDictDataDao{internal.NewSysDictDataDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_dict_type.go b/server/internal/dao/sys_dict_type.go new file mode 100755 index 0000000..102c167 --- /dev/null +++ b/server/internal/dao/sys_dict_type.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysDictTypeDao is the data access object for the table hg_sys_dict_type. +// You can define custom methods on it to extend its functionality as needed. +type sysDictTypeDao struct { + *internal.SysDictTypeDao +} + +var ( + // SysDictType is a globally accessible object for table hg_sys_dict_type operations. + SysDictType = sysDictTypeDao{internal.NewSysDictTypeDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_ems_log.go b/server/internal/dao/sys_ems_log.go new file mode 100755 index 0000000..cad6a7b --- /dev/null +++ b/server/internal/dao/sys_ems_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysEmsLogDao is the data access object for the table hg_sys_ems_log. +// You can define custom methods on it to extend its functionality as needed. +type sysEmsLogDao struct { + *internal.SysEmsLogDao +} + +var ( + // SysEmsLog is a globally accessible object for table hg_sys_ems_log operations. + SysEmsLog = sysEmsLogDao{internal.NewSysEmsLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_gen_codes.go b/server/internal/dao/sys_gen_codes.go new file mode 100755 index 0000000..4e82527 --- /dev/null +++ b/server/internal/dao/sys_gen_codes.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysGenCodesDao is the data access object for the table hg_sys_gen_codes. +// You can define custom methods on it to extend its functionality as needed. +type sysGenCodesDao struct { + *internal.SysGenCodesDao +} + +var ( + // SysGenCodes is a globally accessible object for table hg_sys_gen_codes operations. + SysGenCodes = sysGenCodesDao{internal.NewSysGenCodesDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_gen_curd_demo.go b/server/internal/dao/sys_gen_curd_demo.go new file mode 100755 index 0000000..e67ce1e --- /dev/null +++ b/server/internal/dao/sys_gen_curd_demo.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysGenCurdDemoDao is the data access object for the table hg_sys_gen_curd_demo. +// You can define custom methods on it to extend its functionality as needed. +type sysGenCurdDemoDao struct { + *internal.SysGenCurdDemoDao +} + +var ( + // SysGenCurdDemo is a globally accessible object for table hg_sys_gen_curd_demo operations. + SysGenCurdDemo = sysGenCurdDemoDao{internal.NewSysGenCurdDemoDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_gen_tree_demo.go b/server/internal/dao/sys_gen_tree_demo.go new file mode 100755 index 0000000..8cc7d86 --- /dev/null +++ b/server/internal/dao/sys_gen_tree_demo.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysGenTreeDemoDao is the data access object for the table hg_sys_gen_tree_demo. +// You can define custom methods on it to extend its functionality as needed. +type sysGenTreeDemoDao struct { + *internal.SysGenTreeDemoDao +} + +var ( + // SysGenTreeDemo is a globally accessible object for table hg_sys_gen_tree_demo operations. + SysGenTreeDemo = sysGenTreeDemoDao{internal.NewSysGenTreeDemoDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_log.go b/server/internal/dao/sys_log.go new file mode 100755 index 0000000..fd4f72a --- /dev/null +++ b/server/internal/dao/sys_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysLogDao is the data access object for the table hg_sys_log. +// You can define custom methods on it to extend its functionality as needed. +type sysLogDao struct { + *internal.SysLogDao +} + +var ( + // SysLog is a globally accessible object for table hg_sys_log operations. + SysLog = sysLogDao{internal.NewSysLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_login_log.go b/server/internal/dao/sys_login_log.go new file mode 100755 index 0000000..f158383 --- /dev/null +++ b/server/internal/dao/sys_login_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysLoginLogDao is the data access object for the table hg_sys_login_log. +// You can define custom methods on it to extend its functionality as needed. +type sysLoginLogDao struct { + *internal.SysLoginLogDao +} + +var ( + // SysLoginLog is a globally accessible object for table hg_sys_login_log operations. + SysLoginLog = sysLoginLogDao{internal.NewSysLoginLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_provinces.go b/server/internal/dao/sys_provinces.go new file mode 100755 index 0000000..7e35c53 --- /dev/null +++ b/server/internal/dao/sys_provinces.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysProvincesDao is the data access object for the table hg_sys_provinces. +// You can define custom methods on it to extend its functionality as needed. +type sysProvincesDao struct { + *internal.SysProvincesDao +} + +var ( + // SysProvinces is a globally accessible object for table hg_sys_provinces operations. + SysProvinces = sysProvincesDao{internal.NewSysProvincesDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_serve_license.go b/server/internal/dao/sys_serve_license.go new file mode 100755 index 0000000..6397152 --- /dev/null +++ b/server/internal/dao/sys_serve_license.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysServeLicenseDao is the data access object for the table hg_sys_serve_license. +// You can define custom methods on it to extend its functionality as needed. +type sysServeLicenseDao struct { + *internal.SysServeLicenseDao +} + +var ( + // SysServeLicense is a globally accessible object for table hg_sys_serve_license operations. + SysServeLicense = sysServeLicenseDao{internal.NewSysServeLicenseDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_serve_log.go b/server/internal/dao/sys_serve_log.go new file mode 100755 index 0000000..1fb569d --- /dev/null +++ b/server/internal/dao/sys_serve_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysServeLogDao is the data access object for the table hg_sys_serve_log. +// You can define custom methods on it to extend its functionality as needed. +type sysServeLogDao struct { + *internal.SysServeLogDao +} + +var ( + // SysServeLog is a globally accessible object for table hg_sys_serve_log operations. + SysServeLog = sysServeLogDao{internal.NewSysServeLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/sys_sms_log.go b/server/internal/dao/sys_sms_log.go new file mode 100755 index 0000000..aa2c686 --- /dev/null +++ b/server/internal/dao/sys_sms_log.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// sysSmsLogDao is the data access object for the table hg_sys_sms_log. +// You can define custom methods on it to extend its functionality as needed. +type sysSmsLogDao struct { + *internal.SysSmsLogDao +} + +var ( + // SysSmsLog is a globally accessible object for table hg_sys_sms_log operations. + SysSmsLog = sysSmsLogDao{internal.NewSysSmsLogDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/task.go b/server/internal/dao/task.go new file mode 100644 index 0000000..fe97745 --- /dev/null +++ b/server/internal/dao/task.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// taskDao is the data access object for the table hg_task. +// You can define custom methods on it to extend its functionality as needed. +type taskDao struct { + *internal.TaskDao +} + +var ( + // Task is a globally accessible object for table hg_task operations. + Task = taskDao{internal.NewTaskDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/task_hall.go b/server/internal/dao/task_hall.go new file mode 100644 index 0000000..2be1816 --- /dev/null +++ b/server/internal/dao/task_hall.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// taskHallDao is the data access object for the table hg_task_hall. +// You can define custom methods on it to extend its functionality as needed. +type taskHallDao struct { + *internal.TaskHallDao +} + +var ( + // TaskHall is a globally accessible object for table hg_task_hall operations. + TaskHall = taskHallDao{internal.NewTaskHallDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/task_hall_level.go b/server/internal/dao/task_hall_level.go new file mode 100644 index 0000000..829a21a --- /dev/null +++ b/server/internal/dao/task_hall_level.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// taskHallLevelDao is the data access object for the table hg_task_hall_level. +// You can define custom methods on it to extend its functionality as needed. +type taskHallLevelDao struct { + *internal.TaskHallLevelDao +} + +var ( + // TaskHallLevel is a globally accessible object for table hg_task_hall_level operations. + TaskHallLevel = taskHallLevelDao{internal.NewTaskHallLevelDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/task_level.go b/server/internal/dao/task_level.go new file mode 100644 index 0000000..49bd439 --- /dev/null +++ b/server/internal/dao/task_level.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// taskLevelDao is the data access object for the table hg_task_level. +// You can define custom methods on it to extend its functionality as needed. +type taskLevelDao struct { + *internal.TaskLevelDao +} + +var ( + // TaskLevel is a globally accessible object for table hg_task_level operations. + TaskLevel = taskLevelDao{internal.NewTaskLevelDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/task_submission.go b/server/internal/dao/task_submission.go new file mode 100644 index 0000000..f43d94f --- /dev/null +++ b/server/internal/dao/task_submission.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// taskSubmissionDao is the data access object for the table hg_task_submission. +// You can define custom methods on it to extend its functionality as needed. +type taskSubmissionDao struct { + *internal.TaskSubmissionDao +} + +var ( + // TaskSubmission is a globally accessible object for table hg_task_submission operations. + TaskSubmission = taskSubmissionDao{internal.NewTaskSubmissionDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/test_category.go b/server/internal/dao/test_category.go new file mode 100755 index 0000000..d9e5ab7 --- /dev/null +++ b/server/internal/dao/test_category.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// testCategoryDao is the data access object for the table hg_test_category. +// You can define custom methods on it to extend its functionality as needed. +type testCategoryDao struct { + *internal.TestCategoryDao +} + +var ( + // TestCategory is a globally accessible object for table hg_test_category operations. + TestCategory = testCategoryDao{internal.NewTestCategoryDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/trade_order.go b/server/internal/dao/trade_order.go new file mode 100644 index 0000000..fdf1fa2 --- /dev/null +++ b/server/internal/dao/trade_order.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// tradeOrderDao is the data access object for the table hg_trade_order. +// You can define custom methods on it to extend its functionality as needed. +type tradeOrderDao struct { + *internal.TradeOrderDao +} + +var ( + // TradeOrder is a globally accessible object for table hg_trade_order operations. + TradeOrder = tradeOrderDao{internal.NewTradeOrderDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/wallet_account.go b/server/internal/dao/wallet_account.go new file mode 100644 index 0000000..89208dc --- /dev/null +++ b/server/internal/dao/wallet_account.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// walletAccountDao is the data access object for the table hg_wallet_account. +// You can define custom methods on it to extend its functionality as needed. +type walletAccountDao struct { + *internal.WalletAccountDao +} + +var ( + // WalletAccount is a globally accessible object for table hg_wallet_account operations. + WalletAccount = walletAccountDao{internal.NewWalletAccountDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/wallet_adjustment_request.go b/server/internal/dao/wallet_adjustment_request.go new file mode 100644 index 0000000..acc84ca --- /dev/null +++ b/server/internal/dao/wallet_adjustment_request.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// walletAdjustmentRequestDao is the data access object for the table hg_wallet_adjustment_request. +// You can define custom methods on it to extend its functionality as needed. +type walletAdjustmentRequestDao struct { + *internal.WalletAdjustmentRequestDao +} + +var ( + // WalletAdjustmentRequest is a globally accessible object for table hg_wallet_adjustment_request operations. + WalletAdjustmentRequest = walletAdjustmentRequestDao{internal.NewWalletAdjustmentRequestDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/wallet_ledger.go b/server/internal/dao/wallet_ledger.go new file mode 100644 index 0000000..373beaf --- /dev/null +++ b/server/internal/dao/wallet_ledger.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// walletLedgerDao is the data access object for the table hg_wallet_ledger. +// You can define custom methods on it to extend its functionality as needed. +type walletLedgerDao struct { + *internal.WalletLedgerDao +} + +var ( + // WalletLedger is a globally accessible object for table hg_wallet_ledger operations. + WalletLedger = walletLedgerDao{internal.NewWalletLedgerDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/dao/withdrawal_order.go b/server/internal/dao/withdrawal_order.go new file mode 100644 index 0000000..4714fcf --- /dev/null +++ b/server/internal/dao/withdrawal_order.go @@ -0,0 +1,22 @@ +// ================================================================================= +// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed. +// ================================================================================= + +package dao + +import ( + "hotgo/internal/dao/internal" +) + +// withdrawalOrderDao is the data access object for the table hg_withdrawal_order. +// You can define custom methods on it to extend its functionality as needed. +type withdrawalOrderDao struct { + *internal.WithdrawalOrderDao +} + +var ( + // WithdrawalOrder is a globally accessible object for table hg_withdrawal_order operations. + WithdrawalOrder = withdrawalOrderDao{internal.NewWithdrawalOrderDao()} +) + +// Add your custom methods and functionality below. diff --git a/server/internal/global/cluster.go b/server/internal/global/cluster.go new file mode 100644 index 0000000..6a12ca1 --- /dev/null +++ b/server/internal/global/cluster.go @@ -0,0 +1,51 @@ +// Package global +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package global + +import ( + "context" + "fmt" + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/consts" + "hotgo/internal/library/hgrds/lock" + "hotgo/internal/library/hgrds/pubsub" + "hotgo/internal/service" + "hotgo/utility/simple" +) + +// SubscribeClusterSync 订阅集群同步,可以用来集中同步数据、状态等 +func SubscribeClusterSync(ctx context.Context) { + if !simple.IsCluster(ctx) { + return + } + + err := pubsub.SubscribeMap(map[string]pubsub.SubHandler{ + consts.ClusterSyncSysconfig: service.SysConfig().ClusterSync, // 系统配置 + consts.ClusterSyncSysBlacklist: service.SysBlacklist().ClusterSync, // 系统黑名单 + consts.ClusterSyncSysSuperAdmin: service.AdminMember().ClusterSyncSuperAdmin, // 超管 + }) + + if err != nil { + g.Log().Fatal(ctx, err) + } +} + +// PublishClusterSync 推送集群同步消息,如果没有开启集群部署,则不进行推送 +func PublishClusterSync(ctx context.Context, channel string, message interface{}) { + if !simple.IsCluster(ctx) { + return + } + + mutex := lock.Mutex(fmt.Sprintf("%s:%s", "lock", channel)) + err := mutex.LockFunc(ctx, func() { + if _, err := pubsub.Publish(ctx, channel, message); err != nil { + g.Log().Warningf(ctx, "PublishClusterSync %v err:%v", channel, err) + } + }) + if err != nil { + g.Log().Warningf(ctx, "PublishClusterSync %v LockFunc err:%v", channel, err) + } +} diff --git a/server/internal/global/global.go b/server/internal/global/global.go new file mode 100644 index 0000000..bc2b3e1 --- /dev/null +++ b/server/internal/global/global.go @@ -0,0 +1,8 @@ +// Package global +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package global + +// 在这里可以配置一些全局公用的变量 diff --git a/server/internal/global/httproutes.go b/server/internal/global/httproutes.go new file mode 100644 index 0000000..8a4e535 --- /dev/null +++ b/server/internal/global/httproutes.go @@ -0,0 +1,125 @@ +// Package global +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package global + +import ( + "reflect" + "strings" + "sync" + + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/util/gmeta" + "github.com/gogf/gf/v2/util/gtag" +) + +// HTTPRouter http路由 +type HTTPRouter struct { + ghttp.RouterItem + Tags string `json:"tags" dc:"接口所属的标签,用于接口分类"` + Summary string `json:"summary" dc:"接口/参数概要描述"` + Description string `json:"description" dc:"接口/参数详细描述"` +} + +var ( + httpRoutes map[string]*HTTPRouter + routeMutex sync.Mutex + shortTypeMapForTag = map[string]string{ + gtag.SummaryShort: gtag.Summary, + gtag.SummaryShort2: gtag.Summary, + gtag.DescriptionShort: gtag.Description, + gtag.DescriptionShort2: gtag.Description, + } +) + +// GetRequestRoute 获取当前请求路由属性 +func GetRequestRoute(r *ghttp.Request) *HTTPRouter { + key := GenFilterRequestKey(r) + routes := LoadHTTPRoutes(r) + router, ok := routes[key] + if !ok { + return nil + } + return router +} + +// GenFilterRequestKey 根据请求生成唯一key +func GenFilterRequestKey(r *ghttp.Request) string { + return GenRouteKey(r.Method, r.Request.URL.Path) +} + +// GenFilterRouteKey 根据路由生成唯一key +func GenFilterRouteKey(r *ghttp.Router) string { + return GenRouteKey(r.Method, r.Uri) +} + +// GenRouteKey 生成唯一key +func GenRouteKey(method, path string) string { + return strings.ToUpper(method) + " " + path +} + +func LoadHTTPRoutes(r *ghttp.Request) map[string]*HTTPRouter { + if httpRoutes == nil { + routeMutex.Lock() + defer routeMutex.Unlock() + + if httpRoutes != nil { + return httpRoutes + } + + httpRoutes = make(map[string]*HTTPRouter, len(r.Server.GetRoutes())) + for _, v := range r.Server.GetRoutes() { + key := GenFilterRouteKey(v.Handler.Router) + if _, ok := httpRoutes[key]; !ok { + router := new(HTTPRouter) + router.RouterItem = v + httpRoutes[key] = setRouterMeta(router) + } + } + } + return httpRoutes +} + +func setRouterMeta(router *HTTPRouter) *HTTPRouter { + if !router.RouterItem.Handler.Info.IsStrictRoute { + return router + } + + var reflectValue = reflect.ValueOf(router.Handler.Info.Value.Interface()) + for reflectValue.Kind() == reflect.Ptr { + reflectValue = reflectValue.Elem() + } + + if reflectValue.Kind() != reflect.Func { + return router + } + + var reflectType = reflect.TypeOf(router.Handler.Info.Value.Interface()) + if reflectType.NumIn() != 2 || reflectType.NumOut() != 2 { + return router + } + + var inputObject reflect.Value + if reflectType.In(1).Kind() == reflect.Ptr { + inputObject = reflect.New(reflectType.In(1).Elem()).Elem() + } else { + inputObject = reflect.New(reflectType.In(1)).Elem() + } + + inputMetaMap := fillMapWithShortTags(gmeta.Data(inputObject.Interface())) + router.Tags = inputMetaMap["tags"] + router.Summary = inputMetaMap[gtag.Summary] + router.Description = inputMetaMap[gtag.Description] + return router +} + +func fillMapWithShortTags(m map[string]string) map[string]string { + for k, v := range shortTypeMapForTag { + if m[v] == "" && m[k] != "" { + m[v] = m[k] + } + } + return m +} diff --git a/server/internal/global/init.go b/server/internal/global/init.go new file mode 100644 index 0000000..3666117 --- /dev/null +++ b/server/internal/global/init.go @@ -0,0 +1,168 @@ +// Package global +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package global + +import ( + "context" + "fmt" + "github.com/gogf/gf/contrib/trace/jaeger/v2" + "github.com/gogf/gf/v2" + "github.com/gogf/gf/v2/container/gvar" + "github.com/gogf/gf/v2/encoding/gjson" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gctx" + "github.com/gogf/gf/v2/os/gfile" + "github.com/gogf/gf/v2/os/glog" + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/text/gstr" + "github.com/gogf/gf/v2/util/gmode" + "hotgo/internal/consts" + "hotgo/internal/library/cache" + "hotgo/internal/library/queue" + "hotgo/internal/model/entity" + "hotgo/internal/service" + "hotgo/utility/charset" + "hotgo/utility/simple" + "hotgo/utility/validate" + "runtime" + "strings" +) + +func Init(ctx context.Context) { + // 设置gf运行模式 + SetGFMode(ctx) + + // 设置服务日志处理 + glog.SetDefaultHandler(LoggingServeLogHandler) + + // 默认上海时区 + if err := gtime.SetTimeZone("Asia/Shanghai"); err != nil { + g.Log().Fatalf(ctx, "时区设置异常 err:%+v", err) + return + } + + fmt.Printf("欢迎使用HotGo!\r\n当前运行环境:%v, 运行根路径为:%v \r\nHotGo版本:v%v, gf版本:%v \n", runtime.GOOS, gfile.Pwd(), consts.VersionApp, gf.VERSION) + + // 初始化链路追踪 + InitTrace(ctx) + + // 设置缓存适配器 + cache.SetAdapter(ctx) + + // 初始化功能库配置 + service.SysConfig().InitConfig(ctx) + + // 加载超管数据 + service.AdminMember().LoadSuperAdmin(ctx) + + // 订阅集群同步 + SubscribeClusterSync(ctx) +} + +// LoggingServeLogHandler 服务日志处理 +// 需要将异常日志保存到服务日志时可以通过SetHandlers设置此方法 +func LoggingServeLogHandler(ctx context.Context, in *glog.HandlerInput) { + in.Next(ctx) + + err := g.Try(ctx, func(ctx context.Context) { + var err error + defer func() { + if err != nil { + panic(err) + } + }() + + // web服务日志不做记录,因为会导致重复记录 + r := g.RequestFromCtx(ctx) + if r != nil && r.Server != nil && in.Logger.GetConfig().Path == r.Server.Logger().GetConfig().Path { + return + } + + conf, err := service.SysConfig().GetLoadServeLog(ctx) + if err != nil { + return + } + + if conf == nil { + return + } + + if !conf.Switch { + return + } + + if in.LevelFormat == "" || !gstr.InArray(conf.LevelFormat, in.LevelFormat) { + return + } + + if in.Stack == "" { + in.Stack = in.Logger.GetStack() + } + + if len(in.Content) == 0 { + in.Content = gstr.StrLimit(gvar.New(in.Values).String(), consts.MaxServeLogContentLen) + } + + var data entity.SysServeLog + data.TraceId = gctx.CtxId(ctx) + data.LevelFormat = in.LevelFormat + data.Content = in.Content + data.Stack = gjson.New(charset.ParseStack(in.Stack)) + data.Line = strings.TrimRight(in.CallerPath, ":") + data.TriggerNs = in.Time.UnixNano() + data.Status = consts.StatusEnabled + + if gstr.Contains(in.Content, `exception recovered`) { + data.LevelFormat = "PANI" + } + + if data.Stack.IsNil() { + data.Stack = gjson.New(consts.NilJsonToString) + } + + if conf.Queue { + err = queue.Push(consts.QueueServeLogTopic, data) + } else { + err = service.SysServeLog().RealWrite(ctx, data) + } + }) + + if err != nil { + g.Dump("LoggingServeLogHandler err:", err) + } +} + +// InitTrace 初始化链路追踪 +func InitTrace(ctx context.Context) { + if !g.Cfg().MustGet(ctx, "jaeger.switch").Bool() { + return + } + + tp, err := jaeger.Init(simple.AppName(ctx), g.Cfg().MustGet(ctx, "jaeger.endpoint").String()) + if err != nil { + g.Log().Fatal(ctx, err) + } + + simple.Event().Register(consts.EventServerClose, func(ctx context.Context, args ...interface{}) { + _ = tp.Shutdown(ctx) + g.Log().Debug(ctx, "jaeger closed ..") + }) +} + +// SetGFMode 设置gf运行模式 +func SetGFMode(ctx context.Context) { + mode := g.Cfg().MustGet(ctx, "system.mode").String() + if len(mode) == 0 { + mode = gmode.NOT_SET + } + + var modes = []string{gmode.DEVELOP, gmode.TESTING, gmode.STAGING, gmode.PRODUCT} + + // 如果是有效的运行模式,就进行设置 + if validate.InSlice(modes, mode) { + gmode.Set(mode) + } +} diff --git a/server/internal/library/addons/addons.go b/server/internal/library/addons/addons.go new file mode 100644 index 0000000..dd5f128 --- /dev/null +++ b/server/internal/library/addons/addons.go @@ -0,0 +1,61 @@ +// Package addons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package addons + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/consts" +) + +var cacheResourcePath string + +// GetResourcePath 获取插件资源路径 +func GetResourcePath(ctx context.Context) string { + if len(cacheResourcePath) > 0 { + return cacheResourcePath + } + basePath := g.Cfg().MustGet(ctx, "system.addonsResourcePath").String() + if basePath == "" { + g.Log().Warning(ctx, "addons GetResourcePath not config found:'system.addonsResourcePath', use default values:'resource'") + basePath = "resource" + } + + cacheResourcePath = basePath + return basePath +} + +// GetModulePath 获取指定模块相对路径 +func GetModulePath(name string) string { + return "./" + consts.AddonsDir + "/" + name +} + +// ViewPath 默认的插件模板路径 +// 模板路径:resource/addons/插件模块名称/template +// 例如:resource/addons/hgexample/template +// 如果你不喜欢现在的风格,可以自行调整 +func ViewPath(name, basePath string) string { + return basePath + "/" + consts.AddonsDir + "/" + name + "/template" +} + +// StaticPath 默认的插件静态路映射关系 +// 静态资源路径:resource/public/addons/插件模块名称/public +// 例如访问:http://127.0.0.1:8000/addons/hgexample/default 则指向文件-> resource/addons/hgexample/public/default +// 如果你不喜欢现在的风格,可以自行调整 +func StaticPath(name, basePath string) (string, string) { + return "/" + consts.AddonsDir + "/" + name, basePath + "/" + consts.AddonsDir + "/" + name + "/public" +} + +// RouterPrefix 路由前缀 +// 最终效果:/应用名称/插件模块名称/xxx/xxx。 +// 如果你不喜欢现在的风格,可以自行调整 +func RouterPrefix(ctx context.Context, app, name string) string { + var prefix = "/" + if app != "" { + prefix = g.Cfg().MustGet(ctx, "router."+app+".prefix", "/"+app+"").String() + } + return prefix + "/" + name +} diff --git a/server/internal/library/addons/build.go b/server/internal/library/addons/build.go new file mode 100644 index 0000000..6fab466 --- /dev/null +++ b/server/internal/library/addons/build.go @@ -0,0 +1,138 @@ +// Package addons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package addons + +import ( + "context" + "fmt" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/os/gfile" + "github.com/gogf/gf/v2/text/gstr" + "hotgo/internal/consts" + "hotgo/internal/model" + "hotgo/utility/validate" + "strconv" + "strings" +) + +type BuildOption struct { + Skeleton Skeleton + Config *model.BuildAddonConfig + Extend []string `json:"extend" dc:"扩展功能"` +} + +// Build 构建新插件 +func Build(ctx context.Context, option *BuildOption) (err error) { + var ( + resourcePath = GetResourcePath(ctx) + buildPath = "./" + consts.AddonsDir + "/" + option.Skeleton.Name + modulesPath = "./" + consts.AddonsDir + "/modules/" + option.Skeleton.Name + ".go" + webApiPath = gstr.Replace(option.Config.WebApiPath, "{$name}", option.Skeleton.Name) + webViewsPath = gstr.Replace(option.Config.WebViewsPath, "{$name}", option.Skeleton.Name) + replaces = map[string]string{ + "@{.label}": option.Skeleton.Label, + "@{.name}": option.Skeleton.Name, + "@{.group}": strconv.Itoa(option.Skeleton.Group), + "@{.brief}": option.Skeleton.Brief, + "@{.description}": option.Skeleton.Description, + "@{.author}": option.Skeleton.Author, + "@{.version}": option.Skeleton.Version, + "@{.hgVersion}": consts.VersionApp, // HG 版本 + } + ) + + if resourcePath == "" { + err = gerror.New("请先设置一个有效的插件资源路径,配置名称:'system.addonsResourcePath'") + return + } + + if err = checkBuildDir(buildPath, modulesPath, webApiPath, webViewsPath); err != nil { + return + } + + // scans directory recursively + list, err := gfile.ScanDirFunc(option.Config.SrcPath, "*", true, func(path string) string { + return path + }) + + if err != nil { + return + } + + for _, path := range list { + if !gfile.IsReadable(path) { + err = gerror.Newf("file:%v is unreadable, please check permissions", path) + return + } + + if gfile.IsDir(path) { + continue + } + + flowFile := gstr.ReplaceByMap(path, map[string]string{ + gfile.RealPath(option.Config.SrcPath): "", + ".template": "", + }) + flowFile = buildPath + "/" + flowFile + + content := gstr.ReplaceByMap(gfile.GetContents(path), replaces) + + if err = gfile.PutContents(flowFile, content); err != nil { + break + } + } + + // 隐式注入插件 + if err = gfile.PutContents(modulesPath, gstr.ReplaceByMap(importModules, replaces)); err != nil { + return + } + + // webApi + if err = gfile.PutContents(webApiPath+"/config/index.ts", gstr.ReplaceByMap(webApiLayout, replaces)); err != nil { + return + } + + // web插件配置主页面 + if err = gfile.PutContents(webViewsPath+"/config/BasicSetting.vue", gstr.ReplaceByMap(webConfigBasicSetting, replaces)); err != nil { + return + } + + // web插件基础配置页面 + if err = gfile.PutContents(webViewsPath+"/config/system.vue", gstr.ReplaceByMap(webConfigSystem, replaces)); err != nil { + return + } + + // 创建静态目录 + if validate.InSlice(option.Extend, consts.AddonsExtendResourcePublic) { + _, staticPath := StaticPath(option.Skeleton.Name, resourcePath) + content := fmt.Sprintf(resourcePublicDefaultFile, option.Skeleton.Label) + if err = gfile.PutContents(staticPath+"/default", content); err != nil { + return + } + } + + // 创建模板目录 + if validate.InSlice(option.Extend, consts.AddonsExtendResourceTemplate) { + viewPath := ViewPath(option.Skeleton.Name, resourcePath) + if err = gfile.PutContents(viewPath+"/home/index.html", resourceTemplateHomeFile); err != nil { + return + } + } + return +} + +func checkBuildDir(paths ...string) (err error) { + if len(paths) == 0 { + return + } + + for _, path := range paths { + if gfile.Exists(path) { + return gerror.Newf("插件已存在,请换一个插件名称或者经确认无误后依次删除文件夹: [%v] 后重新生成", strings.Join(paths, "、\t")) + } + } + return +} diff --git a/server/internal/library/addons/build_layout.go b/server/internal/library/addons/build_layout.go new file mode 100644 index 0000000..dd85e96 --- /dev/null +++ b/server/internal/library/addons/build_layout.go @@ -0,0 +1,232 @@ +// Package addons +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package addons + +const ( + importModules = `// Package modules +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package modules + +import _ "hotgo/addons/@{.name}" +` + + webApiLayout = `import { http } from '@/utils/http/axios'; + +export function getConfig(params) { + return http.request({ + url: '/@{.name}/config/get', + method: 'get', + params, + }); +} + +export function updateConfig(params) { + return http.request({ + url: '/@{.name}/config/update', + method: 'post', + params, + }); +} +` + + webConfigBasicSetting = ` +Hello,@{.Data.name}!!
+@{.Data.module}
+服务器时间:@{.Data.time}
+{{ formValue.%s }}\n and
"` + *payin.PayNotifyModel +} + +// NotifyWxPayReq 微信支付回调 +type NotifyWxPayReq struct { + g.Meta `path:"/pay/notify/wxpay" method:"post" tags:"支付异步通知" summary:"微信支付回调"` +} + +type NotifyWxPayRes struct { + *payin.PayNotifyModel +} + +// NotifyQQPayReq QQ支付回调 +type NotifyQQPayReq struct { + g.Meta `path:"/pay/notify/qqpay" method:"post" tags:"支付异步通知" summary:"QQ支付回调"` +} + +type NotifyQQPayRes struct { + g.Meta `mime:"text/xml" type:"string"` + *payin.PayNotifyModel +} diff --git a/server/api/home/base/site.go b/server/api/home/base/site.go new file mode 100644 index 0000000..d70f5ba --- /dev/null +++ b/server/api/home/base/site.go @@ -0,0 +1,16 @@ +// Package base +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package base + +import "github.com/gogf/gf/v2/frame/g" + +type SiteIndexReq struct { + g.Meta `path:"/" method:"get" summary:"首页" tags:"首页"` +} + +type SiteIndexRes struct { + g.Meta `mime:"text/html" type:"string" example:"
"` +} diff --git a/server/api/servmsg/auth.go b/server/api/servmsg/auth.go new file mode 100644 index 0000000..e071144 --- /dev/null +++ b/server/api/servmsg/auth.go @@ -0,0 +1,21 @@ +// Package servmsg +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package servmsg + +import ( + "hotgo/internal/library/network/tcp" + "hotgo/internal/model/input/servmsgin" +) + +// AuthSummaryReq 授权信息 +type AuthSummaryReq struct { +} + +// AuthSummaryRes 响应授权信息 +type AuthSummaryRes struct { + tcp.ServerRes + Data *servmsgin.AuthSummaryModel `json:"data,omitempty" description:"数据集"` +} diff --git a/server/api/servmsg/cron.go b/server/api/servmsg/cron.go new file mode 100644 index 0000000..ab3eafa --- /dev/null +++ b/server/api/servmsg/cron.go @@ -0,0 +1,57 @@ +// Package servmsg +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package servmsg + +import ( + "hotgo/internal/library/network/tcp" + "hotgo/internal/model/input/sysin" +) + +// CronDeleteReq 删除任务 +type CronDeleteReq struct { + *sysin.CronDeleteInp +} + +type CronDeleteRes struct { + tcp.ServerRes +} + +// CronEditReq 编辑任务 +type CronEditReq struct { + *sysin.CronEditInp +} + +type CronEditRes struct { + tcp.ServerRes +} + +// CronStatusReq 修改任务状态 +type CronStatusReq struct { + *sysin.CronStatusInp +} + +type CronStatusRes struct { + tcp.ServerRes +} + +// CronOnlineExecReq 在线执行 +type CronOnlineExecReq struct { + *sysin.OnlineExecInp +} + +type CronOnlineExecRes struct { + tcp.ServerRes +} + +// CronDispatchLogReq 调度日志 +type CronDispatchLogReq struct { + *sysin.DispatchLogInp +} + +type CronDispatchLogRes struct { + tcp.ServerRes + *sysin.DispatchLogModel +} diff --git a/server/api/servmsg/example.go b/server/api/servmsg/example.go new file mode 100644 index 0000000..c469ebf --- /dev/null +++ b/server/api/servmsg/example.go @@ -0,0 +1,33 @@ +// Package servmsg +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package servmsg + +import ( + "hotgo/internal/library/network/tcp" + "hotgo/internal/model/input/servmsgin" +) + +// 一些例子. + +// ExampleHelloReq 一个tcp请求例子 +type ExampleHelloReq struct { + Name string `json:"name" description:"名字"` +} + +type ExampleHelloRes struct { + tcp.ServerRes + Data *servmsgin.ExampleHelloModel `json:"data,omitempty" description:"数据集"` +} + +// ExampleRPCHelloReq 一个rpc请求例子 +type ExampleRPCHelloReq struct { + Name string `json:"name" description:"名字"` +} + +type ExampleRPCHelloRes struct { + tcp.ServerRes + Data *servmsgin.ExampleHelloModel `json:"data,omitempty" description:"数据集"` +} diff --git a/server/api/websocket/base/send.go b/server/api/websocket/base/send.go new file mode 100644 index 0000000..b67d70b --- /dev/null +++ b/server/api/websocket/base/send.go @@ -0,0 +1,20 @@ +// Package base +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package base + +import ( + "github.com/gogf/gf/v2/frame/g" + "hotgo/internal/model/input/websocketin" +) + +// SendToTagReq 发送标签消息 +type SendToTagReq struct { + g.Meta `path:"/send/toTag" method:"post" tags:"WebSocket" summary:"发送标签消息"` + websocketin.SendToTagInp +} + +type SendToTagRes struct { +} diff --git a/server/go.mod b/server/go.mod new file mode 100644 index 0000000..b7a96b6 --- /dev/null +++ b/server/go.mod @@ -0,0 +1,165 @@ +module hotgo + +go 1.24.4 + +require ( + github.com/IBM/sarama v1.45.2 + github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.7 + github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6 + github.com/alibabacloud-go/tea v1.3.9 + github.com/alibabacloud-go/tea-utils/v2 v2.0.7 + github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible + github.com/apache/rocketmq-client-go/v2 v2.1.2 + github.com/casbin/casbin/v2 v2.108.0 + github.com/forgoer/openssl v1.6.1 + github.com/go-pay/crypto v0.0.1 + github.com/go-pay/gopay v1.5.114 + github.com/go-pay/smap v0.0.2 + github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.0 + github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0 + github.com/gogf/gf/contrib/nosql/redis/v2 v2.10.0 + github.com/gogf/gf/contrib/trace/jaeger/v2 v2.7.4 + github.com/gogf/gf/v2 v2.10.0 + github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f + github.com/golang-jwt/jwt/v5 v5.2.2 + github.com/gorilla/websocket v1.5.3 + github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794 + github.com/microcosm-cc/bluemonday v1.0.27 + github.com/minio/minio-go/v7 v7.0.94 + github.com/mojocn/base64Captcha v1.3.8 + github.com/olekukonko/tablewriter v1.1.0 + github.com/qiniu/go-sdk/v7 v7.25.4 + github.com/schollz/progressbar/v3 v3.18.0 + github.com/shirou/gopsutil/v3 v3.24.5 + github.com/silenceper/wechat/v2 v2.1.9 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1202 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1200 + github.com/tencentyun/cos-go-sdk-v5 v0.7.66 + github.com/ufilesdk-dev/ufile-gosdk v1.0.6 + github.com/xuri/excelize/v2 v2.9.1 + go.opentelemetry.io/otel v1.38.0 + golang.org/x/mod v0.26.0 + golang.org/x/net v0.43.0 + golang.org/x/tools v0.35.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + aead.dev/minisign v0.2.0 // indirect + github.com/BurntSushi/toml v1.5.0 // indirect + github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect + github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect + github.com/alibabacloud-go/debug v1.0.1 // indirect + github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect + github.com/alibabacloud-go/openapi-util v0.1.0 // indirect + github.com/alibabacloud-go/tea-utils v1.3.1 // indirect + github.com/aliyun/credentials-go v1.4.5 // indirect + github.com/aymerick/douceur v0.2.0 // indirect + github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect + github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect + github.com/casbin/govaluate v1.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/clbanning/mxj v1.8.4 // indirect + github.com/clbanning/mxj/v2 v2.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/eapache/go-resiliency v1.7.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect + github.com/eapache/queue v1.1.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/emirpasic/gods/v2 v2.0.0-alpha // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/fatih/structs v1.1.0 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/gammazero/toposort v0.1.1 // indirect + github.com/go-ini/ini v1.67.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-pay/errgroup v0.0.3 // indirect + github.com/go-pay/util v0.0.4 // indirect + github.com/go-pay/xlog v0.0.3 // indirect + github.com/go-pay/xtime v0.0.2 // indirect + github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-sql-driver/mysql v1.7.1 // indirect + github.com/goccy/go-json v0.10.5 // indirect + github.com/gofrs/flock v0.8.1 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/golang/mock v1.4.4 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.3 // indirect + github.com/google/go-querystring v1.0.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/css v1.0.1 // indirect + github.com/grokify/html-strip-tags-go v0.1.0 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/jcmturner/aescts/v2 v2.0.0 // indirect + github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect + github.com/jcmturner/gofork v1.7.6 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect + github.com/jcmturner/rpc/v2 v2.0.3 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/magiconair/properties v1.8.10 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/minio/crc64nvme v1.0.1 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mozillazg/go-httpheader v0.2.1 // indirect + github.com/olekukonko/errors v1.1.0 // indirect + github.com/olekukonko/ll v0.0.9 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/pierrec/lz4/v4 v4.1.22 // indirect + github.com/pkg/errors v0.8.1 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/redis/go-redis/v9 v9.12.1 // indirect + github.com/richardlehane/mscfb v1.0.4 // indirect + github.com/richardlehane/msoleps v1.0.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/rs/xid v1.6.0 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/tidwall/gjson v1.14.1 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/tiendc/go-deepcopy v1.6.0 // indirect + github.com/tinylib/msgp v1.3.0 // indirect + github.com/tjfoc/gmsm v1.4.1 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/xuri/efp v0.0.1 // indirect + github.com/xuri/nfp v0.0.1 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect + go.opentelemetry.io/otel/metric v1.38.0 // indirect + go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.uber.org/atomic v1.5.1 // indirect + golang.org/x/crypto v0.41.0 // indirect + golang.org/x/image v0.25.0 // indirect + golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/sys v0.35.0 // indirect + golang.org/x/term v0.34.0 // indirect + golang.org/x/text v0.28.0 // indirect + golang.org/x/time v0.12.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect + modernc.org/fileutil v1.0.0 // indirect + stathat.com/c/consistent v1.0.0 // indirect +) diff --git a/server/go.sum b/server/go.sum new file mode 100644 index 0000000..a8cd3d8 --- /dev/null +++ b/server/go.sum @@ -0,0 +1,706 @@ +aead.dev/minisign v0.2.0 h1:kAWrq/hBRu4AARY6AlciO83xhNnW9UaC8YipS2uhLPk= +aead.dev/minisign v0.2.0/go.mod h1:zdq6LdSd9TbuSxchxwhpA9zEb9YXcVGoE8JakuiGaIQ= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= +github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/IBM/sarama v1.45.2 h1:8m8LcMCu3REcwpa7fCP6v2fuPuzVwXDAM2DOv3CBrKw= +github.com/IBM/sarama v1.45.2/go.mod h1:ppaoTcVdGv186/z6MEKsMm70A5fwJfRTpstI37kVn3Y= +github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 h1:7dONQ3WNZ1zy960TmkxJPuwoolZwL7xKtpcM04MBnt4= +github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82/go.mod h1:nLnM0KdK1CmygvjpDUO6m1TjSsiQtL61juhNsvV/JVI= +github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6 h1:eIf+iGJxdU4U9ypaUfbtOWCsZSbTb8AUHvyPrxu6mAA= +github.com/alibabacloud-go/alibabacloud-gateway-pop v0.0.6/go.mod h1:4EUIoxs/do24zMOGGqYVWgw0s9NtiylnJglOeEB5UJo= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 h1:zE8vH9C7JiZLNJJQ5OwjU9mSi4T9ef9u3BURT6LCLC8= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5/go.mod h1:tWnyE9AjF8J8qqLk645oUmVUnFybApTQWklQmi5tY6g= +github.com/alibabacloud-go/darabonba-array v0.1.0 h1:vR8s7b1fWAQIjEjWnuF0JiKsCvclSRTfDzZHTYqfufY= +github.com/alibabacloud-go/darabonba-array v0.1.0/go.mod h1:BLKxr0brnggqOJPqT09DFJ8g3fsDshapUD3C3aOEFaI= +github.com/alibabacloud-go/darabonba-encode-util v0.0.2 h1:1uJGrbsGEVqWcWxrS9MyC2NG0Ax+GpOM5gtupki31XE= +github.com/alibabacloud-go/darabonba-encode-util v0.0.2/go.mod h1:JiW9higWHYXm7F4PKuMgEUETNZasrDM6vqVr/Can7H8= +github.com/alibabacloud-go/darabonba-map v0.0.2 h1:qvPnGB4+dJbJIxOOfawxzF3hzMnIpjmafa0qOTp6udc= +github.com/alibabacloud-go/darabonba-map v0.0.2/go.mod h1:28AJaX8FOE/ym8OUFWga+MtEzBunJwQGceGQlvaPGPc= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2/go.mod h1:5JHVmnHvGzR2wNdgaW1zDLQG8kOC4Uec8ubkMogW7OQ= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.7 h1:ASXSBga98QrGMxbIThCD6jAti09gedLfvry6yJtsoBE= +github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.7/go.mod h1:TBpgqm3XofZz2LCYjZhektGPU7ArEgascyzbm4SjFo4= +github.com/alibabacloud-go/darabonba-signature-util v0.0.7 h1:UzCnKvsjPFzApvODDNEYqBHMFt1w98wC7FOo0InLyxg= +github.com/alibabacloud-go/darabonba-signature-util v0.0.7/go.mod h1:oUzCYV2fcCH797xKdL6BDH8ADIHlzrtKVjeRtunBNTQ= +github.com/alibabacloud-go/darabonba-string v1.0.2 h1:E714wms5ibdzCqGeYJ9JCFywE5nDyvIXIIQbZVFkkqo= +github.com/alibabacloud-go/darabonba-string v1.0.2/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/debug v1.0.0/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= +github.com/alibabacloud-go/debug v1.0.1 h1:MsW9SmUtbb1Fnt3ieC6NNZi6aEwrXfDksD4QA6GSbPg= +github.com/alibabacloud-go/debug v1.0.1/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= +github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6 h1:UTl97mt2qfavxveqCkaVg4tKaZUPzA9RKbFIRaIdtdg= +github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6/go.mod h1:UWpcGrWwTbES9QW7OQ7xDffukMJ/l7lzioixIz8+lgY= +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/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.11/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/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.20/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.2.2/go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk= +github.com/alibabacloud-go/tea v1.3.8/go.mod h1:A560v/JTQ1n5zklt2BEpurJzZTI8TUT+Psg2drWlxRg= +github.com/alibabacloud-go/tea v1.3.9 h1:bjgt1bvdY780vz/17iWNNtbXl4A77HWntWMeaUF3So0= +github.com/alibabacloud-go/tea v1.3.9/go.mod h1:A560v/JTQ1n5zklt2BEpurJzZTI8TUT+Psg2drWlxRg= +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.3/go.mod h1:sj1PbjPodAVTqGTA3olprfeeqqmwD0A5OQz94o9EuXQ= +github.com/alibabacloud-go/tea-utils/v2 v2.0.5/go.mod h1:dL6vbUT35E4F4bFTHL845eUloqaerYBYPsdWR2/jhe4= +github.com/alibabacloud-go/tea-utils/v2 v2.0.7 h1:WDx5qW3Xa5ZgJ1c8NfqJkF6w+AU5wB8835UdhPr6Ax0= +github.com/alibabacloud-go/tea-utils/v2 v2.0.7/go.mod h1:qxn986l+q33J5VkialKMqT/TTs3E+U9MJpd001iWQ9I= +github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis/v2 v2.30.0 h1:uA3uhDbCxfO9+DI/DuGeAMr9qI+noVWwGPNTFuKID5M= +github.com/alicebob/miniredis/v2 v2.30.0/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q= +github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible h1:8psS8a+wKfiLt1iVDX79F7Y6wUM49Lcha2FMXt4UM8g= +github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= +github.com/aliyun/credentials-go v1.3.1/go.mod h1:8jKYhQuDawt8x2+fusqa1Y6mPxemTsBEN04dgcAcYz0= +github.com/aliyun/credentials-go v1.3.6/go.mod h1:1LxUuX7L5YrZUWzBrRyk0SwSdH4OmPrib8NVePL3fxM= +github.com/aliyun/credentials-go v1.4.5 h1:O76WYKgdy1oQYYiJkERjlA2dxGuvLRrzuO2ScrtGWSk= +github.com/aliyun/credentials-go v1.4.5/go.mod h1:Jm6d+xIgwJVLVWT561vy67ZRP4lPTQxMbEYRuT2Ti1U= +github.com/apache/rocketmq-client-go/v2 v2.1.2 h1:yt73olKe5N6894Dbm+ojRf/JPiP0cxfDNNffKwhpJVg= +github.com/apache/rocketmq-client-go/v2 v2.1.2/go.mod h1:6I6vgxHR3hzrvn+6n/4mrhS+UTulzK/X9LB2Vk1U5gE= +github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= +github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= +github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d h1:pVrfxiGfwelyab6n21ZBkbkmbevaf+WvMIiR7sr97hw= +github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/casbin/casbin/v2 v2.108.0 h1:aMc3I81wfLpQe/uzMdElB1OBhEmPZoWMPb2nfEaKygY= +github.com/casbin/casbin/v2 v2.108.0/go.mod h1:Ee33aqGrmES+GNL17L0h9X28wXuo829wnNUnS0edAco= +github.com/casbin/govaluate v1.3.0 h1:VA0eSY0M2lA86dYd5kPPuNZMUD9QkWnOCnavGrw9myc= +github.com/casbin/govaluate v1.3.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chengxilo/virtualterm v1.0.4 h1:Z6IpERbRVlfB8WkOmtbHiDbBANU7cimRIof7mk9/PwM= +github.com/chengxilo/virtualterm v1.0.4/go.mod h1:DyxxBZz/x1iqJjFxTFcr6/x+jSpqN0iwWCOK1q10rlY= +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/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= +github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= +github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/dave/jennifer v1.6.1/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= +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/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/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.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= +github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/emirpasic/gods/v2 v2.0.0-alpha h1:dwFlh8pBg1VMOXWGipNMRt8v96dKAIvBehtCt6OtunU= +github.com/emirpasic/gods/v2 v2.0.0-alpha/go.mod h1:W0y4M2dtBB9U5z3YlghmpuUhiaZT2h6yoeE+C1sCp6A= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/forgoer/openssl v1.6.1 h1:pBfyCd0p5Htd0CzKhtZ5kPLzRk9XeMdRVnC27AIRKmM= +github.com/forgoer/openssl v1.6.1/go.mod h1:9DZ4yOsQmveP0aXC/BpQ++Y5TKaz5yR9+emcxmIZNZs= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +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.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= +github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/gammazero/toposort v0.1.1 h1:OivGxsWxF3U3+U80VoLJ+f50HcPU1MIqE1JlKzoJ2Eg= +github.com/gammazero/toposort v0.1.1/go.mod h1:H2cozTnNpMw0hg2VHAYsAxmkHXBYroNangj2NTBQDvw= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/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 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-pay/crypto v0.0.1 h1:B6InT8CLfSLc6nGRVx9VMJRBBazFMjr293+jl0lLXUY= +github.com/go-pay/crypto v0.0.1/go.mod h1:41oEIvHMKbNcYlWUlRWtsnC6+ASgh7u29z0gJXe5bes= +github.com/go-pay/errgroup v0.0.3 h1:DB4s8e8oWYDyETKQ1y1riMJ7y29zE1uIsMCSjEOFSbU= +github.com/go-pay/errgroup v0.0.3/go.mod h1:0+4b8mvFMS71MIzsaC+gVvB4x37I93lRb2dqrwuU8x8= +github.com/go-pay/gopay v1.5.114 h1:jNYpcylr7WJev6i/MBeer0Z58E0x5NyqG4FfZrar3pQ= +github.com/go-pay/gopay v1.5.114/go.mod h1:p48xvWeepPolZuakAjCeucWynWwW7msoXsqahcoJpKE= +github.com/go-pay/smap v0.0.2 h1:kKflYor5T5FgZltPFBMTFfjJvqYMHr5VnIFSEyhVTcA= +github.com/go-pay/smap v0.0.2/go.mod h1:HW9oAo0okuyDYsbpbj5fJFxnNj/BZorRGFw26SxrNWw= +github.com/go-pay/util v0.0.4 h1:TuwSU9o3Qd7m9v1PbzFuIA/8uO9FJnA6P7neG/NwPyk= +github.com/go-pay/util v0.0.4/go.mod h1:Tsdhs8Ib9J9b4+NKNO1PHh5hWHhlg98PthsX0ckq6PM= +github.com/go-pay/xlog v0.0.3 h1:avyMhCL/JgBHreoGx/am/kHxfs1udDOAeVqbmzP/Yes= +github.com/go-pay/xlog v0.0.3/go.mod h1:mH47xbobrdsSHWsmFtSF5agWbMHFP+tK0ZbVCk5OAEw= +github.com/go-pay/xtime v0.0.2 h1:7YR4/iuELsEHpJ6LUO0SVK80hQxDO9MLCfuVYIiTCRM= +github.com/go-pay/xtime v0.0.2/go.mod h1:W1yRbJaSt4CSBcdAtLBQ8xajiN/Pl5hquGczUcUE9xE= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.7.0/go.mod h1:xm76BBt941f7yWdGnI2DVPFFg1UK3YY04qifoXU3lOk= +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.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= +github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.0 h1:UvqxwinkelKxwdwnKUfdy51/ls4RL7MCeJqAZOVAy0I= +github.com/gogf/gf/contrib/drivers/mysql/v2 v2.10.0/go.mod h1:6v7oGBF9wv59WERJIOJxXmLhkUcxwON3tPYW3AZ7wbY= +github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0 h1:39+jbTenm7KBj4hO2C8ANAxVHpX/7OuRDs1VcGC9ylA= +github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0/go.mod h1:B0s0fVzn0W220E8UTpSGzrrGKsop5KcB90twBeLCiz0= +github.com/gogf/gf/contrib/nosql/redis/v2 v2.10.0 h1:N/F9CuDdUZLoM1nVRqrDE/33pDZuhVxpNY4wYdeIaBs= +github.com/gogf/gf/contrib/nosql/redis/v2 v2.10.0/go.mod h1:x6uoJGfZOtirIRQls8xUlYzC6f7T/eULPUa9er368X0= +github.com/gogf/gf/contrib/trace/jaeger/v2 v2.7.4 h1:JnUjXb7C9vmwcZFwXqnxi9H4/I0rir9LmRryIX7xNds= +github.com/gogf/gf/contrib/trace/jaeger/v2 v2.7.4/go.mod h1:A3NhV8u45twLq5VdqObhYNhT4szLFLCROw4LzHM+lYg= +github.com/gogf/gf/v2 v2.10.0 h1:rzDROlyqGMe/eM6dCalSR8dZOuMIdLhmxKSH1DGhbFs= +github.com/gogf/gf/v2 v2.10.0/go.mod h1:Svl1N+E8G/QshU2DUbh/3J/AJauqCgUnxHurXWR4Qx0= +github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f h1:7xfXR/BhG3JDqO1s45n65Oyx9t4E/UqDOXep6jXdLCM= +github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f/go.mod h1:HnYoio6S7VaFJdryKcD/r9HgX+4QzYfr00XiXUo/xz0= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= +github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +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/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/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.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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +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.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.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.1.1/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.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= +github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +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 v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4= +github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +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-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/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/json-iterator/go v1.1.10/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/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794 h1:dWJxw+KQOMeVcoyxqG9I5fppPld1hh1FG8ngv0fKNsQ= +github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794/go.mod h1:IwrOeG3O3K9vVXmcVvc9T0XLabw67QePi5pKQt5U+Kw= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +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/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +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/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE= +github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +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.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= +github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA= +github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY= +github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= +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.94 h1:1ZoksIKPyaSt64AVOyaQvhDOgVC3MfZsWM6mZXRUGtM= +github.com/minio/minio-go/v7 v7.0.94/go.mod h1:71t2CqDt3ThzESgZUlU1rBN54mksGGlkLcFgguDnnAc= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/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/mojocn/base64Captcha v1.3.8 h1:rrN9BhCwXKS8ht1e21kvR3iTaMgf4qPC9sRoV52bqEg= +github.com/mojocn/base64Captcha v1.3.8/go.mod h1:QFZy927L8HVP3+VV5z2b1EAEiv1KxVJKZbAucVgLUy4= +github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= +github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= +github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +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/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM= +github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y= +github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI= +github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g= +github.com/olekukonko/tablewriter v1.1.0 h1:N0LHrshF4T39KvI96fn6GT8HEjXRXYNDrDjKFDB7RIY= +github.com/olekukonko/tablewriter v1.1.0/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +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/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 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +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/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= +github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= +github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= +github.com/pierrec/lz4/v4 v4.1.22/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.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +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/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/qiniu/dyn v1.3.0/go.mod h1:E8oERcm8TtwJiZvkQPbcAh0RL8jO1G0VXJMW3FAWdkk= +github.com/qiniu/go-sdk/v7 v7.25.4 h1:ulCKlTEyrZzmNytXweOrnva49+Q4+ASjYBCSXhkRWTo= +github.com/qiniu/go-sdk/v7 v7.25.4/go.mod h1:dmKtJ2ahhPWFVi9o1D5GemmWoh/ctuB9peqTowyTO8o= +github.com/qiniu/x v1.10.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/redis/go-redis/v9 v9.12.1 h1:k5iquqv27aBtnTm2tIkROUDp8JBXhXZIVu1InSgvovg= +github.com/redis/go-redis/v9 v9.12.1/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= +github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM= +github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= +github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00= +github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= +github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= +github.com/schollz/progressbar/v3 v3.18.0 h1:uXdoHABRFmNIjUfte/Ex7WtuyVslrw2wVPQmCN62HpA= +github.com/schollz/progressbar/v3 v3.18.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec= +github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= +github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= +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/silenceper/wechat/v2 v2.1.9 h1:wc092gUkGbbBRTdzPxROhQhOH5iE98stnfzKA73mnTo= +github.com/silenceper/wechat/v2 v2.1.9/go.mod h1:7Iu3EhQYVtDUJAj+ZVRy8yom75ga7aDWv8RurLkVm0s= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.1.0 h1:MkTeG1DMwsrdH7QtLXy5W+fUxWq+vmb6cLmyJ7aRtF0= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +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/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 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.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1200/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1202 h1:3QTQZXLLGLALyHNHs6WAsFCWvElMEXfOdaFM01/3Zjo= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1202/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1200 h1:bu2Jqn/rc5CQslIgTCyG4CTqMpkz2luIOq7dzuLp4G8= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1200/go.mod h1:JzzUsHoueCXnMEYcgorKxyfR0OZAI416XKgHEpgyO7o= +github.com/tencentyun/cos-go-sdk-v5 v0.7.66 h1:O4O6EsozBoDjxWbltr3iULgkI7WPj/BFNlYTXDuE64E= +github.com/tencentyun/cos-go-sdk-v5 v0.7.66/go.mod h1:8+hG+mQMuRP/OIS9d83syAvXvrMj9HhkND6Q1fLghw0= +github.com/tidwall/gjson v1.13.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.1 h1:iymTbGkQBhveq21bEvAQ81I0LEBork8BFe1CUZXdyuo= +github.com/tidwall/gjson v1.14.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tiendc/go-deepcopy v1.6.0 h1:0UtfV/imoCwlLxVsyfUd4hNHnB3drXsfle+wzSCA5Wo= +github.com/tiendc/go-deepcopy v1.6.0/go.mod h1:toXoeQoUqXOOS/X4sKuiAoSk6elIdqc0pN7MTgOOo2I= +github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww= +github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= +github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho= +github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= +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/ufilesdk-dev/ufile-gosdk v1.0.6 h1:YhTZfA0U5zjKUe6qYrIs72jjxSZryTMbS9wE76fIxMs= +github.com/ufilesdk-dev/ufile-gosdk v1.0.6/go.mod h1:s1LIpscsgVNx0JRNbDElNNQhyNXJiumVpzvPzVNS/XI= +github.com/xuri/efp v0.0.1 h1:fws5Rv3myXyYni8uwj2qKjVaRP30PdjeYe2Y6FDsCL8= +github.com/xuri/efp v0.0.1/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.9.1 h1:VdSGk+rraGmgLHGFaGG9/9IWu1nj4ufjJ7uwMDtj8Qw= +github.com/xuri/excelize/v2 v2.9.1/go.mod h1:x7L6pKz2dvo9ejrRuD8Lnl98z4JLt0TGAwjhW+EiP8s= +github.com/xuri/nfp v0.0.1 h1:MDamSGatIvp8uOmDP8FnmjuQpu90NzdJxo7242ANR9Q= +github.com/xuri/nfp v0.0.1/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= +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.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= +github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= +go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= +go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= +go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= +go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= +go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= +go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= +go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= +go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= +go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= +go.uber.org/atomic v1.5.1 h1:rsqfU5vBkVknbhUGbAUwQKR2H4ItV8tjJ+6kJX4cxHM= +go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/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-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-20201012173705-84dcc777aaee/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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +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/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4= +golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY= +golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ= +golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= +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-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= +golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +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-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-20190620200207-3b0461eec859/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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/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-20201010224723-4f7140c49acb/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-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +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.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= +golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +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-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-20201020160332-67f06af15bc9/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +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-20190204203706-41f3e6584952/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-20190412213103-97732733099d/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-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-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-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/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-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20220520151302-bc2c85ada10a/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.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.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= +golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +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/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= +golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= +golang.org/x/text v0.3.0/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.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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= +golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/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-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= +golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= +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= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +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.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +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= +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-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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= +gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= +gopkg.in/ini.v1 v1.56.0/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 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +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/yaml.v2 v2.2.2/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.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-20210107192922-496545a6307b/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-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +modernc.org/fileutil v1.0.0 h1:Z1AFLZwl6BO8A5NldQg/xTSjGLetp+1Ubvl4alfGx8w= +modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= +stathat.com/c/consistent v1.0.0 h1:ezyc51EGcRPJUxfHGSgJjWzJdj3NiMU9pNfLNGiXV0c= +stathat.com/c/consistent v1.0.0/go.mod h1:QkzMWzcbB+yQBL2AttO6sgsQS/JSTapcDISJalmCDS0= diff --git a/server/hack/config.yaml b/server/hack/config.yaml new file mode 100644 index 0000000..6024ef6 --- /dev/null +++ b/server/hack/config.yaml @@ -0,0 +1,48 @@ +# CLI tool, only in development environment. +# https://goframe.org/pages/viewpage.action?pageId=3673173 +gfcli: + build: + name: "hotgo" # 编译后的可执行文件名称 + arch: "amd64" # 不填默认当前系统架构,可选:386,amd64,arm,all + system: "linux" # 不填默认当前系统平台,可选:linux,darwin,windows,all + mod: "none" + cgo: 0 + packSrc: "resource" # 将resource目录打包进可执行文件,静态资源无需单独部署 + packDst: "internal/packed/packed.go" # 打包后生成的Go文件路径,一般使用相对路径指定到本项目目录中 + version: "" + output: "./temp/hotgo" # 可执行文件生成路径 + extra: "" + + + docker: + build: "-a amd64 -s linux -p temp -ew" # 构建参数 + tagPrefixes: # 该docker的标记前缀,用于docker推送,请替换成你自己的 + - ccr.ccs.tencentyun.com/bufanyun + + + gen: + dao: + - link: "mysql:root:root@tcp(127.0.0.1:3306)/olons_admin?loc=Local&parseTime=true&charset=utf8mb4" +# - link: "pgsql:postgres:hg123456@tcp(127.0.0.1:5432)/hotgo" + group: "default" # 分组 使用hotgo代码生成功能时必须填 + # tables: "" # 指定当前数据库中需要执行代码生成的数据表。如果为空,表示数据库的所有表都会生成。 + tablesEx: "hg_sys_addons_install" # 指定当前数据库中需要排除代码生成的数据表。 + removePrefix: "hg_" + descriptionTag: true + noModelComment: true + jsonCase: "CamelLower" + gJsonSupport: true + clear: false + + +# service: # 生成业务配置 +# srcFolder: "internal/logic" +# dstFolder: "internal/service" +# dstFileNameCase: "CamelLower" +# clear: true + ctrl: + # api/api下的接口可以使用gf gen ctrl自动生成控制器相关代码 + srcFolder: "api/api" + dstFolder: "internal/controller/api" + clear: true + merge: false diff --git a/server/internal/cmd/auth.go b/server/internal/cmd/auth.go new file mode 100644 index 0000000..dc3e045 --- /dev/null +++ b/server/internal/cmd/auth.go @@ -0,0 +1,35 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gcmd" + "hotgo/internal/service" +) + +var ( + Auth = &gcmd.Command{ + Name: "auth", + Brief: "系统授权,当为第三方客户开发应用项目不想将源码和可执行文件让其随意使用时,可以通过授权的方式约束使用方。", + Description: `目前已实现,一对一、一对多、有效期授权,具体使用可以参考现有逻辑结合实际场景进行改造`, + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + service.AuthClient().Start(ctx) + + serverWg.Add(1) + + // 信号监听 + signalListen(ctx, signalHandlerForOverall) + + <-serverCloseSignal + service.AuthClient().Stop(ctx) + g.Log().Debug(ctx, "auth successfully closed ..") + serverWg.Done() + return + }, + } +) diff --git a/server/internal/cmd/cmd.go b/server/internal/cmd/cmd.go new file mode 100644 index 0000000..154016c --- /dev/null +++ b/server/internal/cmd/cmd.go @@ -0,0 +1,86 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gcmd" + "hotgo/utility/simple" +) + +var ( + Main = &gcmd.Command{ + Description: `默认启动所有服务`, + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + return All.Func(ctx, parser) + }, + } + + Help = &gcmd.Command{ + Name: "help", + Brief: "查看帮助", + Description: ` + 命令提示符 + --------------------------------------------------------------------------------- + 启动服务 + >> 所有服务 [go run main.go] 热编译 [gf run main.go] + >> HTTP服务 [go run main.go http] + >> 消息队列 [go run main.go queue] + >> 定时任务 [go run main.go cron] + >> 查看帮助 [go run main.go help] + + --------------------------------------------------------------------------------- + 工具 + >> 释放casbin权限,用于清理无效的权限设置 [go run main.go tools -m=casbin -a1=refresh] + >> 打印所有打包的资源文件列表 [go run main.go tools -m=gres -a1=dump] + >> 打印指定打包的资源文件内容 [go run main.go tools -m=gres -a1=content -a2=resource/template/home/index.html] + --------------------------------------------------------------------------------- + 升级更新 + >> 修复菜单关系树 [go run main.go up -m=fix -a1=menuTree] + --------------------------------------------------------------------------------- + 更多 + github地址:https://github.com/bufanyun/hotgo + 文档地址:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN + HotGo框架交流1群:190966648 + `, + } + + All = &gcmd.Command{ + Name: "all", + Brief: "start all server", + Description: "this is the command entry for starting all server", + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + g.Log().Debug(ctx, "starting all server") + + // 需要启动的服务 + var allServers = []*gcmd.Command{Http, Queue, Cron} + + for _, server := range allServers { + var cmd = server + simple.SafeGo(ctx, func(ctx context.Context) { + if err := cmd.Func(ctx, parser); err != nil { + g.Log().Fatalf(ctx, "%v start fail:%v", cmd.Name, err) + } + }) + } + + // 信号监听 + signalListen(ctx, signalHandlerForOverall) + + <-serverCloseSignal + serverWg.Wait() + g.Log().Debug(ctx, "all service successfully closed ..") + return + }, + } +) + +func init() { + if err := Main.AddCommand(All, Http, Queue, Cron, Auth, Tools, Up, Help); err != nil { + panic(err) + } +} diff --git a/server/internal/cmd/cron.go b/server/internal/cmd/cron.go new file mode 100644 index 0000000..0b2fd49 --- /dev/null +++ b/server/internal/cmd/cron.go @@ -0,0 +1,45 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "github.com/gogf/gf/v2/os/gcmd" + _ "hotgo/internal/crons" + "hotgo/internal/global" + "hotgo/internal/library/cron" + "hotgo/internal/service" +) + +var ( + Cron = &gcmd.Command{ + Name: "cron", + Brief: "定时任务,用来部署一些可独立运行的定时任务,通过tcp方式和后台保持长连接通讯,动态调整任务属性。", + Description: ``, + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + // 服务日志处理 + cron.Logger().SetHandlers(global.LoggingServeLogHandler) + + // 启动定时任务 + service.SysCron().StartCron(ctx) + + // tcp客户端 + service.CronClient().Start(ctx) + + serverWg.Add(1) + + // 信号监听 + signalListen(ctx, signalHandlerForOverall) + + <-serverCloseSignal + service.CronClient().Stop(ctx) + cron.StopALL() + cron.Logger().Debug(ctx, "cron successfully closed ..") + serverWg.Done() + return + }, + } +) diff --git a/server/internal/cmd/handler_shutdown.go b/server/internal/cmd/handler_shutdown.go new file mode 100644 index 0000000..61a51ba --- /dev/null +++ b/server/internal/cmd/handler_shutdown.go @@ -0,0 +1,44 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "github.com/gogf/gf/v2/os/gctx" + "github.com/gogf/gf/v2/os/gproc" + "hotgo/internal/consts" + "hotgo/utility/simple" + "os" + "sync" +) + +var ( + serverCloseSignal = make(chan struct{}, 1) + serverWg = sync.WaitGroup{} + once sync.Once +) + +// signalHandlerForOverall 关闭信号处理 +func signalHandlerForOverall(sig os.Signal) { + serverCloseEvent(gctx.GetInitCtx()) + serverCloseSignal <- struct{}{} +} + +// signalListen 信号监听 +func signalListen(ctx context.Context, handler ...gproc.SigHandler) { + simple.SafeGo(ctx, func(ctx context.Context) { + gproc.AddSigHandlerShutdown(handler...) + gproc.Listen() + }) +} + +// serverCloseEvent 关闭事件 +// 区别于服务收到退出信号后的处理,只会执行一次 +func serverCloseEvent(ctx context.Context) { + once.Do(func() { + simple.Event().Call(consts.EventServerClose, ctx) + }) +} diff --git a/server/internal/cmd/http.go b/server/internal/cmd/http.go new file mode 100644 index 0000000..7a4cb3e --- /dev/null +++ b/server/internal/cmd/http.go @@ -0,0 +1,106 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/net/ghttp" + "github.com/gogf/gf/v2/os/gcmd" + "github.com/gogf/gf/v2/util/gmode" + "hotgo/internal/library/addons" + "hotgo/internal/library/casbin" + "hotgo/internal/library/hggen" + "hotgo/internal/router" + "hotgo/internal/service" + "hotgo/internal/websocket" +) + +var ( + Http = &gcmd.Command{ + Name: "http", + Usage: "http", + Brief: "HTTP服务,也可以称为主服务,包含http、websocket、tcpserver多个可对外服务", + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + // 初始化http服务 + s := g.Server() + + // 初始化请求前回调 + s.BindHookHandler("/*any", ghttp.HookBeforeServe, service.Hook().BeforeServe) + + // 请求响应结束后回调 + s.BindHookHandler("/*any", ghttp.HookAfterOutput, service.Hook().AfterOutput) + + // 注册全局中间件 + s.BindMiddleware("/*any", []ghttp.HandlerFunc{ + service.Middleware().Ctx, // 初始化请求上下文,一般需要第一个进行加载,后续中间件存在依赖关系 + service.Middleware().CORS, // 跨域中间件,自动处理跨域问题 + service.Middleware().Blacklist, // IP黑名单中间件,如果请求IP被后台拉黑,所有请求将被拒绝 + service.Middleware().DemoLimit, // 演示系統操作限制,当开启演示模式时,所有POST请求将被拒绝 + service.Middleware().PreFilter, // 请求输入预处理,api使用gf规范路由并且XxxReq结构体实现了validate.Filter接口即可隐式预处理 + service.Middleware().ResponseHandler, // HTTP响应预处理,在业务处理完成后,对响应结果进行格式化和错误过滤,将处理后的数据发送给请求方 + }...) + + s.Group("/", func(group *ghttp.RouterGroup) { + // 注册后台路由 + router.Admin(ctx, group) + + // 注册Api路由 + router.Api(ctx, group) + + // 注册websocket路由 + router.WebSocket(ctx, group) + + // 注册前台页面路由 + router.Home(ctx, group) + }) + + // 启动插件 + if err = addons.StartModules(ctx, &addons.Option{Server: s}); err != nil { + return err + } + + // 初始化casbin权限 + casbin.InitEnforcer(ctx) + + // 初始化生成代码配置 + if !gmode.IsProduct() { + hggen.InIt(ctx) + } + + // 启动tcp服务 + service.TCPServer().Start(ctx) + + // 启动服务监控 + service.AdminMonitor().StartMonitor(ctx) + + // 加载ip访问黑名单 + service.SysBlacklist().Load(ctx) + + // 注册支付成功回调方法 + service.Pay().RegisterNotifyCall() + + serverWg.Add(1) + + // 信号监听 + signalListen(ctx, signalHandlerForOverall) + + go func() { + <-serverCloseSignal + websocket.Stop() // 关闭websocket + service.TCPServer().Stop(ctx) // 关闭tcp服务器 + addons.StopModules(ctx) // 停止插件 + _ = s.Shutdown() // 关闭http服务,主服务建议放在最后一个关闭 + g.Log().Debug(ctx, "http successfully closed ..") + serverWg.Done() + }() + + // Just run the server. + s.Run() + return + }, + } +) diff --git a/server/internal/cmd/queue.go b/server/internal/cmd/queue.go new file mode 100644 index 0000000..a8dbb5d --- /dev/null +++ b/server/internal/cmd/queue.go @@ -0,0 +1,43 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "github.com/gogf/gf/v2/os/gcmd" + "hotgo/internal/global" + "hotgo/internal/library/queue" + _ "hotgo/internal/queues" + "hotgo/utility/simple" +) + +var ( + Queue = &gcmd.Command{ + Name: "queue", + Brief: "消息队列", + Description: ``, + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + // 服务日志处理 + queue.Logger().SetHandlers(global.LoggingServeLogHandler) + + simple.SafeGo(ctx, func(ctx context.Context) { + queue.Logger().Debug(ctx, "start queue consumer..") + queue.StartConsumersListener(ctx) + queue.Logger().Debug(ctx, "start queue consumer success..") + }) + + serverWg.Add(1) + + // 信号监听 + signalListen(ctx, signalHandlerForOverall) + + <-serverCloseSignal + queue.Logger().Debug(ctx, "queue successfully closed ..") + serverWg.Done() + return + }, + } +) diff --git a/server/internal/cmd/tools.go b/server/internal/cmd/tools.go new file mode 100644 index 0000000..c098f08 --- /dev/null +++ b/server/internal/cmd/tools.go @@ -0,0 +1,107 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "fmt" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gcmd" + "github.com/gogf/gf/v2/os/gres" + "hotgo/internal/library/casbin" +) + +var ( + Tools = &gcmd.Command{ + Name: "tools", + Brief: "常用工具", + Description: ``, + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + args := parser.GetOptAll() + g.Log().Debugf(ctx, "tools args:%v", args) + if len(args) == 0 { + err = gerror.New("tools args cannot be empty.") + return + } + + method, ok := args["m"] + if !ok { + err = gerror.New("tools method cannot be empty.") + return + } + + switch method { + case "casbin": + err = handleCasbin(ctx, args) + case "gres": + err = handleGRes(ctx, args) + default: + err = gerror.Newf("tools method[%v] does not exist", method) + } + + if err == nil { + g.Log().Info(ctx, "tools exec successful!") + } + return + }, + } +) + +// handleCasbin casbin. +func handleCasbin(ctx context.Context, args map[string]string) (err error) { + a1, ok := args["a1"] + if !ok { + err = gerror.New("casbin args cannot be empty.") + return + } + + casbin.InitEnforcer(ctx) + switch a1 { + case "clear": + err = casbin.Clear(ctx) + case "refresh": + err = casbin.Refresh(ctx) + default: + err = gerror.Newf("casbin a1 is invalid, a1:%v", a1) + } + return +} + +func handleGRes(ctx context.Context, args map[string]string) (err error) { + a1, ok := args["a1"] + if !ok { + err = gerror.New("gres args cannot be empty.") + return + } + + switch a1 { + case "dump": + gres.Dump() + case "content": + path, ok := args["a2"] + if !ok { + err = gerror.New("缺少查看文件路径参数:`a2`") + return + } + + if !gres.Contains(path) { + err = gerror.Newf("没有找到资源文件:%v", path) + return + } + content := string(gres.GetContent(path)) + + if len(content) == 0 { + err = gerror.Newf("没有找到资源文件内容,请确认传入`a2`参数是一个文件,a2:%v", path) + return + } + fmt.Println("以下是资源文件内容:") + fmt.Println(content) + default: + err = gerror.Newf("handleGRes a1 is invalid, a1:%v", a1) + } + return +} diff --git a/server/internal/cmd/up.go b/server/internal/cmd/up.go new file mode 100644 index 0000000..cbfc045 --- /dev/null +++ b/server/internal/cmd/up.go @@ -0,0 +1,65 @@ +// Package cmd +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package cmd + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gcmd" + "hotgo/internal/cmd/upgrade/fix" +) + +var ( + Up = &gcmd.Command{ + Name: "up", + Brief: "处理hotgo版本升级更新带来的兼容问题", + Description: ``, + Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { + args := parser.GetOptAll() + g.Log().Debugf(ctx, "up args:%v", args) + if len(args) == 0 { + err = gerror.New("up args cannot be empty.") + return + } + + method, ok := args["m"] + if !ok { + err = gerror.New("up method cannot be empty.") + return + } + + switch method { + case "fix": + err = handleUpgradeFix(ctx, args) + default: + err = gerror.Newf("up method[%v] does not exist", method) + } + + if err == nil { + g.Log().Info(ctx, "up exec successful!") + } + return + }, + } +) + +// handleUpgradeFix 处理修复脚本 +func handleUpgradeFix(ctx context.Context, args map[string]string) (err error) { + a1, ok := args["a1"] + if !ok { + err = gerror.New("fix args cannot be empty.") + return + } + + switch a1 { + case "menuTree": + fix.UpdateAdminMenuTree(ctx) + default: + err = gerror.Newf("fix a1 is invalid, a1:%v", a1) + } + return +} diff --git a/server/internal/cmd/upgrade/fix/admin_menu_tree.go b/server/internal/cmd/upgrade/fix/admin_menu_tree.go new file mode 100644 index 0000000..e5c7d66 --- /dev/null +++ b/server/internal/cmd/upgrade/fix/admin_menu_tree.go @@ -0,0 +1,48 @@ +// Package fix +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package fix + +import ( + "context" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" + "hotgo/internal/dao" + "hotgo/internal/library/hgorm" + "hotgo/internal/model/entity" +) + +// UpdateAdminMenuTree 更新菜单关系树 +// 根据树等级从上到下依次检查,将无效的关系树进行修复更新 +func UpdateAdminMenuTree(ctx context.Context) { + var list []*entity.AdminMenu + err := dao.AdminMenu.Ctx(ctx).OrderAsc("level").Scan(&list) + if err != nil { + g.Log().Fatal(ctx, err) + } + + genUpdateData := func(v *entity.AdminMenu) g.Map { + update := g.Map{"updated_at": gtime.Now()} + if v.Pid <= 0 { + update["level"] = 1 + update["tree"] = "" + return update + } + + // 生成下级关系树 + update["pid"], update["level"], update["tree"], err = hgorm.GenSubTree(ctx, &dao.AdminMenu, v.Pid) + return update + } + + for _, v := range list { + update := genUpdateData(v) + if v.Level == update["level"] && v.Tree == update["tree"] { + continue + } + if _, err = dao.AdminMenu.Ctx(ctx).WherePri(v.Id).Data(genUpdateData(v)).Update(); err != nil { + g.Log().Fatal(ctx, err) + } + } +} diff --git a/server/internal/consts/addons.go b/server/internal/consts/addons.go new file mode 100644 index 0000000..3384bbf --- /dev/null +++ b/server/internal/consts/addons.go @@ -0,0 +1,80 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +func init() { + dict.RegisterEnums("addonsGroupOptions", "插件分组", AddonsGroupOptions) + dict.RegisterEnums("addonsInstallStatus", "插件安装状态", AddonsInstallStatusOptions) + dict.RegisterEnums("addonsExtend", "插件扩展", AddonsExtendOptions) +} + +const ( + AddonsTag = "addons_" // 插件标签前缀 + AddonsDir = "addons" // 插件路径 +) + +const ( + AddonsGroupPlug = 1 // 功能扩展 + AddonsGroupBusiness = 2 // 主要业务 + AddonsGroupThirdParty = 3 // 第三方插件 + AddonsGroupMiniApp = 4 // 小程序 + AddonsGroupCustomer = 5 // 客户关系 + AddonsGroupActivity = 6 // 营销及活动 + AddonsGroupServices = 7 // 常用服务及工具 + AddonsGroupBiz = 8 // 行业解决方案 +) + +// AddonsGroupOptions 插件分组选项 +var AddonsGroupOptions = []*model.Option{ + dict.GenInfoOption(AddonsGroupPlug, "功能扩展"), + dict.GenInfoOption(AddonsGroupBusiness, "主要业务"), + dict.GenInfoOption(AddonsGroupThirdParty, "第三方插件"), + dict.GenInfoOption(AddonsGroupMiniApp, "小程序"), + dict.GenInfoOption(AddonsGroupCustomer, "客户关系"), + dict.GenInfoOption(AddonsGroupActivity, "营销及活动"), + dict.GenInfoOption(AddonsGroupServices, "常用服务及工具"), + dict.GenInfoOption(AddonsGroupBiz, "行业解决方案"), +} + +var AddonsGroupIconMap = map[int]string{ + AddonsGroupPlug: "AppstoreAddOutlined", + AddonsGroupBusiness: "FireOutlined", + AddonsGroupThirdParty: "ApiOutlined", + AddonsGroupMiniApp: "RocketOutlined", + AddonsGroupCustomer: "UserSwitchOutlined", + AddonsGroupActivity: "TagOutlined", + AddonsGroupServices: "ToolOutlined", + AddonsGroupBiz: "CheckCircleOutlined", +} + +const ( + AddonsInstallStatusOk = 1 // 已安装 + AddonsInstallStatusNo = 2 // 未安装 + AddonsInstallStatusUn = 3 // 已卸载 +) + +// AddonsInstallStatusOptions 插件安装状态 +var AddonsInstallStatusOptions = []*model.Option{ + dict.GenInfoOption(AddonsInstallStatusOk, "已安装"), + dict.GenInfoOption(AddonsInstallStatusNo, "未安装"), + dict.GenInfoOption(AddonsInstallStatusUn, "已卸载"), +} + +const ( + AddonsExtendResourcePublic = "resourcePublic" + AddonsExtendResourceTemplate = "resourceTemplate" +) + +// AddonsExtendOptions 插件扩展选项 +var AddonsExtendOptions = []*model.Option{ + dict.GenInfoOption(AddonsExtendResourcePublic, "创建静态目录"), + dict.GenInfoOption(AddonsExtendResourceTemplate, "创建模板目录"), +} diff --git a/server/internal/consts/app.go b/server/internal/consts/app.go new file mode 100644 index 0000000..9b57213 --- /dev/null +++ b/server/internal/consts/app.go @@ -0,0 +1,15 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 应用类型 +const ( + AppAdmin = "admin" + AppApi = "api" + AppHome = "home" + AppWebSocket = "websocket" + AppDefault = "default" +) diff --git a/server/internal/consts/app_member.go b/server/internal/consts/app_member.go new file mode 100644 index 0000000..4d18ddf --- /dev/null +++ b/server/internal/consts/app_member.go @@ -0,0 +1,105 @@ +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +const ( + AppMemberStatusNormal = 1 + AppMemberStatusDisabled = 2 + AppMemberStatusCancelled = 3 + AppMemberRiskNormal = 1 + AppMemberRiskWatch = 2 + AppMemberRiskBlocked = 3 + AppMemberDispatchAuto = 1 + AppMemberDispatchManual = 2 + AppMemberCategoryReal = 1 + AppMemberCategoryFake = 2 + PaymentAccountBank = 1 + PaymentAccountDigital = 2 + PaymentAccountUnionPay = 3 + PaymentAccountAlipay = 4 + PaymentAccountWechat = 5 + WalletDirectionIncome = 1 + WalletDirectionExpense = 2 + WalletAdjustReward = 1 + WalletAdjustSupplement = 2 + WalletAdjustDeduct = 3 + WalletAdjustReversal = 4 + WalletAdjustOther = 5 + WalletRequestPending = 1 + WalletRequestApproved = 2 + WalletRequestRejected = 3 + WalletRequestExecuted = 4 + MemberNoticeReal = 1 + MemberNoticeSimulation = 2 + MemberNoticeActive = 1 + MemberNoticeRevoked = 2 +) + +var ( + AppMemberStatusOptions = []*model.Option{ + dict.GenSuccessOption(AppMemberStatusNormal, "正常"), + dict.GenWarningOption(AppMemberStatusDisabled, "禁用"), + dict.GenErrorOption(AppMemberStatusCancelled, "已注销"), + } + AppMemberRiskStatusOptions = []*model.Option{ + dict.GenSuccessOption(AppMemberRiskNormal, "正常"), + dict.GenWarningOption(AppMemberRiskWatch, "观察"), + dict.GenErrorOption(AppMemberRiskBlocked, "拦截"), + } + AppMemberDispatchModeOptions = []*model.Option{ + dict.GenSuccessOption(AppMemberDispatchAuto, "自动"), + dict.GenDefaultOption(AppMemberDispatchManual, "手动"), + } + AppMemberCategoryOptions = []*model.Option{ + dict.GenSuccessOption(AppMemberCategoryReal, "真人"), + dict.GenWarningOption(AppMemberCategoryFake, "假人"), + } + PaymentAccountTypeOptions = []*model.Option{ + dict.GenPrimaryOption(PaymentAccountBank, "银行卡"), + dict.GenInfoOption(PaymentAccountDigital, "数字钱包"), + dict.GenSuccessOption(PaymentAccountUnionPay, "云闪付"), + dict.GenPrimaryOption(PaymentAccountAlipay, "支付宝"), + dict.GenSuccessOption(PaymentAccountWechat, "微信"), + } + WalletAdjustTypeOptions = []*model.Option{ + dict.GenSuccessOption(WalletAdjustReward, "奖励金"), + dict.GenPrimaryOption(WalletAdjustSupplement, "人工补账"), + dict.GenErrorOption(WalletAdjustDeduct, "差错扣回"), + dict.GenWarningOption(WalletAdjustReversal, "冲正"), + dict.GenDefaultOption(WalletAdjustOther, "其他"), + } + WalletDirectionOptions = []*model.Option{ + dict.GenSuccessOption(WalletDirectionIncome, "收入"), + dict.GenErrorOption(WalletDirectionExpense, "支出"), + } + WalletRequestStatusOptions = []*model.Option{ + dict.GenWarningOption(WalletRequestPending, "待审批"), + dict.GenPrimaryOption(WalletRequestApproved, "已通过"), + dict.GenErrorOption(WalletRequestRejected, "已拒绝"), + dict.GenSuccessOption(WalletRequestExecuted, "已执行"), + } + MemberNoticeSourceOptions = []*model.Option{ + dict.GenSuccessOption(MemberNoticeReal, "真实通知"), + dict.GenWarningOption(MemberNoticeSimulation, "运营模拟"), + } + MemberNoticeStatusOptions = []*model.Option{ + dict.GenSuccessOption(MemberNoticeActive, "有效"), + dict.GenErrorOption(MemberNoticeRevoked, "已撤回"), + } +) + +func init() { + dict.RegisterEnums("appMemberStatus", "会员状态", AppMemberStatusOptions) + dict.RegisterEnums("appMemberRiskStatus", "会员风控状态", AppMemberRiskStatusOptions) + dict.RegisterEnums("appMemberDispatchMode", "会员派单模式", AppMemberDispatchModeOptions) + dict.RegisterEnums("appMemberCategory", "会员类别", AppMemberCategoryOptions) + dict.RegisterEnums("paymentAccountType", "收款账户类型", PaymentAccountTypeOptions) + dict.RegisterEnums("walletAdjustType", "钱包调整类型", WalletAdjustTypeOptions) + dict.RegisterEnums("walletDirection", "钱包变更方向", WalletDirectionOptions) + dict.RegisterEnums("walletRequestStatus", "钱包调整状态", WalletRequestStatusOptions) + dict.RegisterEnums("memberNoticeSource", "会员通知来源", MemberNoticeSourceOptions) + dict.RegisterEnums("memberNoticeStatus", "会员通知状态", MemberNoticeStatusOptions) +} diff --git a/server/internal/consts/approval.go b/server/internal/consts/approval.go new file mode 100644 index 0000000..22311fb --- /dev/null +++ b/server/internal/consts/approval.go @@ -0,0 +1,66 @@ +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +const ( + ApprovalStatusDraft = 1 + ApprovalStatusPending = 2 + ApprovalStatusReviewing = 3 + ApprovalStatusApproved = 4 + ApprovalStatusRejected = 5 + ApprovalStatusCancelled = 6 + ApprovalStatusExecuted = 7 + ApprovalStatusExecuteFailed = 8 +) + +const ( + ApprovalActionSubmit = 1 + ApprovalActionApprove = 2 + ApprovalActionReject = 3 + ApprovalActionReturn = 4 + ApprovalActionCancel = 5 + ApprovalActionExecute = 6 +) + +const ( + ApprovalRiskLow = 1 + ApprovalRiskMedium = 2 + ApprovalRiskHigh = 3 + ApprovalRiskCritical = 4 +) + +var ApprovalStatusOptions = []*model.Option{ + dict.GenDefaultOption(ApprovalStatusDraft, "草稿"), + dict.GenWarningOption(ApprovalStatusPending, "待审批"), + dict.GenPrimaryOption(ApprovalStatusReviewing, "审批中"), + dict.GenSuccessOption(ApprovalStatusApproved, "已通过"), + dict.GenErrorOption(ApprovalStatusRejected, "已驳回"), + dict.GenInfoOption(ApprovalStatusCancelled, "已取消"), + dict.GenSuccessOption(ApprovalStatusExecuted, "已执行"), + dict.GenErrorOption(ApprovalStatusExecuteFailed, "执行失败"), +} + +var ApprovalActionOptions = []*model.Option{ + dict.GenPrimaryOption(ApprovalActionSubmit, "提交"), + dict.GenSuccessOption(ApprovalActionApprove, "通过"), + dict.GenErrorOption(ApprovalActionReject, "驳回"), + dict.GenWarningOption(ApprovalActionReturn, "退回"), + dict.GenInfoOption(ApprovalActionCancel, "取消"), + dict.GenPrimaryOption(ApprovalActionExecute, "执行"), +} + +var ApprovalRiskLevelOptions = []*model.Option{ + dict.GenSuccessOption(ApprovalRiskLow, "低"), + dict.GenInfoOption(ApprovalRiskMedium, "中"), + dict.GenWarningOption(ApprovalRiskHigh, "高"), + dict.GenErrorOption(ApprovalRiskCritical, "极高"), +} + +func init() { + dict.RegisterEnums("approvalStatus", "审批状态", ApprovalStatusOptions) + dict.RegisterEnums("approvalAction", "审批动作", ApprovalActionOptions) + dict.RegisterEnums("approvalRiskLevel", "审批风险等级", ApprovalRiskLevelOptions) +} diff --git a/server/internal/consts/cache.go b/server/internal/consts/cache.go new file mode 100644 index 0000000..e1313b8 --- /dev/null +++ b/server/internal/consts/cache.go @@ -0,0 +1,13 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// cache +const ( + CacheToken = "token" // 登录token + CacheTokenBind = "token_bind" // 登录用户身份绑定 + CacheMultipartUpload = "multipart_upload" // 分片上传 +) diff --git a/server/internal/consts/captcha.go b/server/internal/consts/captcha.go new file mode 100644 index 0000000..c5c7a75 --- /dev/null +++ b/server/internal/consts/captcha.go @@ -0,0 +1,6 @@ +package consts + +const ( + CaptchaTypeString = iota + 1 // 字符串 + CaptchaTypeMath // 数字计算 +) diff --git a/server/internal/consts/cash.go b/server/internal/consts/cash.go new file mode 100644 index 0000000..f215d85 --- /dev/null +++ b/server/internal/consts/cash.go @@ -0,0 +1,13 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 提现状态 +const ( + CashStatusWait = 1 // 处理中 + CashStatusOk = 2 // 提现成功 + CashStatusFail = 3 // 提现异常 +) diff --git a/server/internal/consts/config.go b/server/internal/consts/config.go new file mode 100644 index 0000000..1a85e77 --- /dev/null +++ b/server/internal/consts/config.go @@ -0,0 +1,117 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "github.com/gogf/gf/v2/util/gconv" +) + +// RequestEncryptKey +// 请求加密密钥用于敏感数据加密,16位字符,前后端需保持一致 +// 安全起见,生产环境运行时请注意修改 +var RequestEncryptKey = []byte("f080a463654b2279") + +// 配置数据类型 +const ( + ConfigTypeString = "string" + ConfigTypeInt = "int" + ConfigTypeInt8 = "int8" + ConfigTypeInt16 = "int16" + ConfigTypeInt32 = "int32" + ConfigTypeInt64 = "int64" + ConfigTypeUint = "uint" + ConfigTypeUint8 = "uint8" + ConfigTypeUint16 = "uint16" + ConfigTypeUint32 = "uint32" + ConfigTypeUint64 = "uint64" + ConfigTypeFloat32 = "float32" + ConfigTypeFloat64 = "float64" + ConfigTypeBool = "bool" + ConfigTypeDate = "date" + ConfigTypeDateTime = "datetime" + ConfigTypeSliceString = "[]string" + ConfigTypeSliceInt = "[]int" + ConfigTypeSliceInt64 = "[]int64" +) + +var ConfigTypes = []string{ConfigTypeString, + ConfigTypeInt, ConfigTypeInt8, ConfigTypeInt16, ConfigTypeInt32, ConfigTypeInt64, + ConfigTypeUint, ConfigTypeUint8, ConfigTypeUint16, ConfigTypeUint32, ConfigTypeUint64, + ConfigTypeFloat32, ConfigTypeFloat64, + ConfigTypeBool, + ConfigTypeDate, ConfigTypeDateTime, + ConfigTypeSliceString, ConfigTypeSliceInt, ConfigTypeSliceInt64, +} + +// ConfigMaskDemoField 演示环境下需要隐藏的配置 +var ConfigMaskDemoField = map[string]struct{}{ + // 邮箱 + "smtpUser": {}, "smtpPass": {}, + + // 云存储 + "uploadUCloudPublicKey": {}, "uploadUCloudPrivateKey": {}, "uploadCosSecretId": {}, "uploadCosSecretKey": {}, + "uploadOssSecretId": {}, "uploadOssSecretKey": {}, "uploadQiNiuAccessKey": {}, "uploadQiNiuSecretKey": {}, + + // 地图 + "geoAmapWebKey": {}, + + // 短信 + "smsAliYunAccessKeyID": {}, "smsAliYunAccessKeySecret": {}, "smsTencentSecretId": {}, "smsTencentSecretKey": {}, + + // 支付 + "payWxPayMchId": {}, "payWxPaySerialNo": {}, "payWxPayAPIv3Key": {}, "payWxPayPrivateKey": {}, "payQQPayMchId": {}, "payQQPayApiKey": {}, + + // 微信 + "officialAccountAppSecret": {}, "officialAccountToken": {}, "officialAccountEncodingAESKey": {}, "openPlatformAppSecret": {}, + "openPlatformToken": {}, "openPlatformEncodingAESKey": {}, +} + +// ConvType 类型转换 +func ConvType(val interface{}, t string) interface{} { + switch t { + case ConfigTypeString: + val = gconv.String(val) + case ConfigTypeInt: + val = gconv.Int(val) + case ConfigTypeInt8: + val = gconv.Int8(val) + case ConfigTypeInt16: + val = gconv.Int16(val) + case ConfigTypeInt32: + val = gconv.Int32(val) + case ConfigTypeInt64: + val = gconv.Int64(val) + case ConfigTypeUint: + val = gconv.Uint(val) + case ConfigTypeUint8: + val = gconv.Uint8(val) + case ConfigTypeUint16: + val = gconv.Uint16(val) + case ConfigTypeUint32: + val = gconv.Uint32(val) + case ConfigTypeUint64: + val = gconv.Uint64(val) + case ConfigTypeFloat32: + val = gconv.Float32(val) + case ConfigTypeFloat64: + val = gconv.Float64(val) + case ConfigTypeBool: + val = gconv.Bool(val) + case ConfigTypeDate: + val = gconv.Time(val, "Y-m-d") + case ConfigTypeDateTime: + val = gconv.Time(val, "Y-m-d H:i:s") + case ConfigTypeSliceInt: + val = gconv.SliceInt(val) + case ConfigTypeSliceInt64: + val = gconv.SliceInt64(val) + case ConfigTypeSliceString: + val = gconv.SliceStr(val) + default: + val = gconv.String(val) + } + return val +} diff --git a/server/internal/consts/context.go b/server/internal/consts/context.go new file mode 100644 index 0000000..38acd81 --- /dev/null +++ b/server/internal/consts/context.go @@ -0,0 +1,15 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +type CtxKey string + +// ContextKey 上下文 +const ( + ContextHTTPKey CtxKey = "httpContext" // http上下文变量名称 + ContextKeyCronArgs CtxKey = "cronArgs" // 定时任务参数 + ContextKeyCronSn CtxKey = "cronSn" // 定时任务序列号 +) diff --git a/server/internal/consts/credit_log.go b/server/internal/consts/credit_log.go new file mode 100644 index 0000000..c06d654 --- /dev/null +++ b/server/internal/consts/credit_log.go @@ -0,0 +1,48 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +func init() { + dict.RegisterEnums("creditType", "资金变动类型", CreditTypeOptions) + dict.RegisterEnums("creditGroup", "资金变动分组", CreditGroupOptions) +} + +const ( + CreditTypeBalance = "balance" // 余额 + CreditTypeIntegral = "integral" // 积分 +) + +const ( + CreditGroupDecr = "decr" // 扣款 + CreditGroupIncr = "incr" // 加款 + CreditGroupOpDecr = "op_decr" // 操作扣款 + CreditGroupOpIncr = "op_incr" // 操作加款 + CreditGroupBalanceRecharge = "balance_recharge" // 余额充值 + CreditGroupBalanceRefund = "balance_refund" // 余额退款 + CreditGroupApplyCash = "apply_cash" // 申请提现 +) + +// CreditTypeOptions 变动类型 +var CreditTypeOptions = []*model.Option{ + dict.GenSuccessOption(CreditTypeBalance, "余额"), + dict.GenInfoOption(CreditTypeIntegral, "积分"), +} + +// CreditGroupOptions 变动分组 +var CreditGroupOptions = []*model.Option{ + dict.GenWarningOption(CreditGroupDecr, "扣款"), + dict.GenSuccessOption(CreditGroupIncr, "加款"), + dict.GenWarningOption(CreditGroupOpDecr, "操作扣款"), + dict.GenSuccessOption(CreditGroupOpIncr, "操作加款"), + dict.GenWarningOption(CreditGroupBalanceRefund, "余额退款"), + dict.GenSuccessOption(CreditGroupBalanceRecharge, "余额充值"), + dict.GenInfoOption(CreditGroupApplyCash, "申请提现"), +} diff --git a/server/internal/consts/cron.go b/server/internal/consts/cron.go new file mode 100644 index 0000000..b2ec551 --- /dev/null +++ b/server/internal/consts/cron.go @@ -0,0 +1,17 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// +package consts + +// 定时任务 + +const ( + CronSplitStr = "," // 变量分割符 + CronPolicySame = 1 // 并行策略 + CronPolicySingle = 2 // 单例策略 + CronPolicyOnce = 3 // 单次策略 + CronPolicyTimes = 4 // 多次策略 +) diff --git a/server/internal/consts/debris.go b/server/internal/consts/debris.go new file mode 100644 index 0000000..531c34c --- /dev/null +++ b/server/internal/consts/debris.go @@ -0,0 +1,37 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2025 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 碎片 + +const ( + DemoTips = "演示系统已隐藏" // 演示系统敏感数据打码 + NilJsonToString = "{}" // 空json初始化值 + RegionSpilt = " / " // 地区分隔符 + Unknown = "Unknown" // Unknown + SuperRoleKey = "super" // 超管角色唯一标识符,通过角色验证超管 + MaxServeLogContentLen = 2048 // 最大保留服务日志内容大小 + SysDefaultLanguage = "zh_CN" // 系统默认语言,当配置文件没有国际化配置时生效 +) + +// curd. +const ( + DefaultPage = 10 // 默认列表分页加载数量 + DefaultPageSize = 1 // 默认列表分页加载页码 + MaxSortIncr = 10 // 最大排序值增量 +) + +// TenantField 租户字段 +const ( + TenantId = "tenant_id" // 租户ID + MerchantId = "merchant_id" // 商户ID + UserId = "user_id" // 用户ID +) + +const ( + DBMysql = "mysql" + DBPgsql = "pgsql" +) diff --git a/server/internal/consts/dept.go b/server/internal/consts/dept.go new file mode 100644 index 0000000..7c2f2d6 --- /dev/null +++ b/server/internal/consts/dept.go @@ -0,0 +1,30 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2024 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +func init() { + dict.RegisterEnums("deptType", "部门类型选项", DeptTypeOptions) +} + +const ( + DeptTypeCompany = "company" // 公司 + DeptTypeTenant = "tenant" // 租户 + DeptTypeMerchant = "merchant" // 商户 + DeptTypeUser = "user" // 用户 +) + +// DeptTypeOptions 部门类型选项 +var DeptTypeOptions = []*model.Option{ + dict.GenSuccessOption(DeptTypeCompany, "公司"), + dict.GenErrorOption(DeptTypeTenant, "租户"), + dict.GenInfoOption(DeptTypeMerchant, "商户"), + dict.GenWarningOption(DeptTypeUser, "用户"), +} diff --git a/server/internal/consts/ems.go b/server/internal/consts/ems.go new file mode 100644 index 0000000..5191153 --- /dev/null +++ b/server/internal/consts/ems.go @@ -0,0 +1,38 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import "github.com/gogf/gf/v2/frame/g" + +// 邮件内置模板 +const ( + EmsTemplateText = "text" // 通用文本 + EmsTemplateCode = "code" // 通用验证码 + EmsTemplateLogin = "login" // 登录 + EmsTemplateRegister = "register" // 注册 + EmsTemplateResetPwd = "resetPwd" // 重置密码 + EmsTemplateBind = "bind" // 绑定邮箱 + EmsTemplateCash = "cash" // 申请提现 +) + +var EmsSubjectMap = g.MapStrStr{ + EmsTemplateText: "这是一封来自HotGo的邮件", + EmsTemplateCode: "验证码", + EmsTemplateLogin: "登录验证码", + EmsTemplateRegister: "注册验证码", + EmsTemplateResetPwd: "重置密码", + EmsTemplateBind: "绑定邮箱验证码", + EmsTemplateCash: "申请提现验证码", +} + +// IsCodeEmsTemplate 是否是验证码类型的模板 +func IsCodeEmsTemplate(template string) bool { + return template == EmsTemplateCode || + template == EmsTemplateLogin || + template == EmsTemplateRegister || + template == EmsTemplateBind || + template == EmsTemplateCash +} diff --git a/server/internal/consts/error.go b/server/internal/consts/error.go new file mode 100644 index 0000000..fa392ed --- /dev/null +++ b/server/internal/consts/error.go @@ -0,0 +1,35 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "github.com/gogf/gf/v2/text/gstr" +) + +// 错误解释 +const ( + ErrorORM = "sql执行异常" + ErrorNotData = "数据不存在" + ErrorRotaPointer = "指针转换异常" +) + +// 需要隐藏真实错误的Wrap,开启访问日志后仍然会将真实错误记录 +var concealErrorSlice = []string{ErrorORM, ErrorRotaPointer} + +// ErrorMessage 错误显示信息,非debug模式有效 +func ErrorMessage(err error) (message string) { + if err == nil { + return "操作失败!~" + } + + message = err.Error() + for _, e := range concealErrorSlice { + if gstr.Contains(message, e) { + return "操作失败,请稍后重试!~" + } + } + return +} diff --git a/server/internal/consts/event.go b/server/internal/consts/event.go new file mode 100644 index 0000000..e3e6ca3 --- /dev/null +++ b/server/internal/consts/event.go @@ -0,0 +1,10 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +const ( + EventServerClose = "server.close" // 服务关闭事件 +) diff --git a/server/internal/consts/gencodes.go b/server/internal/consts/gencodes.go new file mode 100644 index 0000000..88da4e7 --- /dev/null +++ b/server/internal/consts/gencodes.go @@ -0,0 +1,96 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +// 生成代码类型 +const ( + GenCodesTypeCurd = 10 // 增删改查列表 + GenCodesTypeTree = 11 // 树列表 + GenCodesTypeQueue = 20 // 队列消费者 + GenCodesTypeCron = 30 // 定时任务 +) + +var GenCodesTypeNameMap = map[int]string{ + GenCodesTypeCurd: "增删改查列表", + GenCodesTypeTree: "关系树列表", + GenCodesTypeQueue: "队列消费者(未实现)", + GenCodesTypeCron: "定时任务(未实现)", +} + +var GenCodesTypeConfMap = map[int]string{ + GenCodesTypeCurd: "crud", + GenCodesTypeTree: "tree", + GenCodesTypeQueue: "queue", + GenCodesTypeCron: "cron", +} + +// 生成代码状态 +const ( + GenCodesStatusOk = 1 // 生成成功 + GenCodesStatusWait = 2 // 未生成 + GenCodesStatusFail = 3 // 生成失败 +) + +var GenCodesStatusNameMap = map[int]string{ + GenCodesStatusOk: "生成成功", + GenCodesStatusWait: "未生成", + GenCodesStatusFail: "生成失败", +} + +// 生成代码关联表方式 +const ( + GenCodesJoinLeft = 1 // 左关联 + GenCodesJoinRight = 2 // 右关联 + GenCodesJoinInner = 3 // 内关联 +) + +var GenCodesJoinNameMap = map[int]string{ + GenCodesJoinLeft: "左关联", + GenCodesJoinRight: "右关联", + GenCodesJoinInner: "内关联", +} + +var GenCodesJoinLinkMap = map[int]string{ + GenCodesJoinLeft: "LeftJoin", + GenCodesJoinRight: "RightJoin", + GenCodesJoinInner: "InnerJoin", +} + +// 生成代码的生成方式 +const ( + GenCodesBuildMethCreate = 1 // 创建 + GenCodesBuildMethCover = 2 // 覆盖 + GenCodesBuildMethSkip = 3 // 跳过 + GenCodesBuildIgnore = 4 // 不生成 +) + +var GenCodesBuildMethNameMap = map[int]string{ + GenCodesBuildMethCreate: "创建文件", + GenCodesBuildMethCover: "强制覆盖", + GenCodesBuildMethSkip: "已存在跳过", + GenCodesBuildIgnore: "不生成", +} + +const ( + GenCodesIndexPK = "PRI" // 主键索引 + GenCodesIndexUNI = "UNI" // 唯一索引 +) + +const ( + GenCodesTreeStyleTypeNormal = 1 // 普通树表格 + GenCodesTreeStyleTypeOption = 2 // 选项式树表 +) + +// GenCodesTreeStyleTypeOptions 树表样式选项 +var GenCodesTreeStyleTypeOptions = []*model.Option{ + dict.GenSuccessOption(GenCodesTreeStyleTypeNormal, "普通树表格"), + dict.GenInfoOption(GenCodesTreeStyleTypeOption, "选项式树表"), +} diff --git a/server/internal/consts/http.go b/server/internal/consts/http.go new file mode 100644 index 0000000..019168e --- /dev/null +++ b/server/internal/consts/http.go @@ -0,0 +1,63 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "fmt" + "hotgo/internal/library/dict" + "hotgo/internal/model" + "net/http" + + "github.com/gogf/gf/v2/errors/gcode" +) + +func init() { + dict.RegisterEnums("HTTPMethod", "HTTP请求方式选项", HTTPMethodOptions) + dict.RegisterEnums("HTTPHandlerTime", "HTTP处理耗时选项", HTTPHandlerTimeOptions) + dict.RegisterEnums("HTTPApiCode", "HTTP接口状态码选项", HTTPApiCodeOptions) +} + +const ( + HTTPContentTypeXml = "text/xml" + HTTPContentTypeHtml = "text/html" + HTTPContentTypeStream = "text/event-stream" + HTTPContentTypeJson = "application/json" + HTTPContentTypeOctetStream = "application/octet-stream" +) + +// HTTPMethodOptions HTTP请求方式选项 +var HTTPMethodOptions = []*model.Option{ + dict.GenSuccessOption(http.MethodGet, "GET"), + dict.GenInfoOption(http.MethodPost, "POST"), + dict.GenSuccessOption(http.MethodPut, "PUT"), + dict.GenInfoOption(http.MethodDelete, "DELETE"), +} + +const ( + HTTPHandlerTime50 = "< 50" + HTTPHandlerTime200 = "< 200" + HTTPHandlerTime200To500 = "BETWEEN 200 AND 500" + HTTPHandlerTime500To1000 = "BETWEEN 500 AND 1000" + HTTPHandlerTime1000To10000 = "BETWEEN 1000 AND 10000" + HTTPHandlerTime10000UP = "> 10000" +) + +// HTTPHandlerTimeOptions HTTP处理耗时选项 +var HTTPHandlerTimeOptions = []*model.Option{ + dict.GenSuccessOption(HTTPHandlerTime50, "50ms以内"), + dict.GenInfoOption(HTTPHandlerTime200, "200ms以内"), + dict.GenSuccessOption(HTTPHandlerTime200To500, "200~500ms"), + dict.GenSuccessOption(HTTPHandlerTime500To1000, "500~1000ms"), + dict.GenInfoOption(HTTPHandlerTime1000To10000, "1000~10000ms"), + dict.GenInfoOption(HTTPHandlerTime10000UP, "10000ms以上"), +} + +// HTTPApiCodeOptions HTTP接口状态码选项 +var HTTPApiCodeOptions = []*model.Option{ + dict.GenSuccessOption(gcode.CodeOK.Code(), fmt.Sprintf("%v %v", gcode.CodeOK.Code(), "成功")), + dict.GenWarningOption(gcode.CodeNil.Code(), fmt.Sprintf("%v %v", gcode.CodeNil.Code(), "失败")), + dict.GenWarningOption(gcode.CodeSecurityReason.Code(), fmt.Sprintf("%v %v", gcode.CodeSecurityReason.Code(), "无访问权限")), +} diff --git a/server/internal/consts/notice.go b/server/internal/consts/notice.go new file mode 100644 index 0000000..ff4ea63 --- /dev/null +++ b/server/internal/consts/notice.go @@ -0,0 +1,13 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 公告类型 +const ( + NoticeTypeNotify = 1 // 通知 + NoticeTypeNotice = 2 // 公告 + NoticeTypeLetter = 3 // 私信 +) diff --git a/server/internal/consts/order.go b/server/internal/consts/order.go new file mode 100644 index 0000000..007a1f2 --- /dev/null +++ b/server/internal/consts/order.go @@ -0,0 +1,66 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +func init() { + dict.RegisterEnums("orderStatus", "订单状态", OrderStatusOptions) + dict.RegisterEnums("acceptRefundStatus", "订单退款受理状态", OrderAcceptRefundOptions) +} + +// 订单分组 +// 为不同的业务订单设置不同的分组,分组可以设置不同的业务回调方法 + +const ( + OrderGroupDefault = "order" // 普通订单 + OrderGroupAdminOrder = "admin_order" // 后台充值订单 + // 还可以设置其他,方便后期扩展.. +) + +// 订单类型 + +const ( + OrderTypeBalance = "balance" // 余额充值 + OrderTypeProduct = "product" // 购买产品 +) + +const ( + OrderStatusALL = -1 // 全部状态 + OrderStatusNotPay = 1 // 待付款 + OrderStatusPay = 2 // 已付款 + OrderStatusShipments = 3 // 已发货 + OrderStatusDone = 4 // 已完成 + OrderStatusClose = 5 // 已关闭 + OrderStatusReturnRequest = 6 // 申请退款 + OrderStatusReturning = 7 // 退款中 + OrderStatusReturned = 8 // 已退款 + OrderStatusReturnReject = 9 // 拒绝退款 +) + +// OrderStatusOptions 订单状态选项 +var OrderStatusOptions = []*model.Option{ + dict.GenInfoOption(OrderStatusALL, "全部"), + dict.GenInfoOption(OrderStatusNotPay, "待付款"), + dict.GenInfoOption(OrderStatusPay, "已付款"), + dict.GenInfoOption(OrderStatusShipments, "已发货"), + dict.GenSuccessOption(OrderStatusDone, "已完成"), + dict.GenDefaultOption(OrderStatusClose, "已关闭"), + dict.GenWarningOption(OrderStatusReturnRequest, "申请退款"), + dict.GenDefaultOption(OrderStatusReturning, "退款中"), + dict.GenErrorOption(OrderStatusReturned, "已退款"), + dict.GenWarningOption(OrderStatusReturnReject, "拒绝退款"), +} + +// OrderAcceptRefundOptions 订单退款受理状态 +var OrderAcceptRefundOptions = []*model.Option{ + dict.GenWarningOption(OrderStatusReturnRequest, "申请退款"), + dict.GenSuccessOption(OrderStatusReturned, "已退款"), + dict.GenErrorOption(OrderStatusReturnReject, "拒绝退款"), +} diff --git a/server/internal/consts/pay.go b/server/internal/consts/pay.go new file mode 100644 index 0000000..f09f57f --- /dev/null +++ b/server/internal/consts/pay.go @@ -0,0 +1,105 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +// 支付方式 + +func init() { + dict.RegisterEnums("payType", "支付方式", PayTypeOptions) + dict.RegisterEnums("payStatus", "支付状态", PayStatusOptions) +} + +const ( + PayTypeALL = "" // 全部 + PayTypeWxPay = "wxpay" // 微信支付 + PayTypeAliPay = "alipay" // 支付宝 + PayTypeQQPay = "qqpay" // QQ支付 + PayTypeBalance = "balance" // 余额支付 + PayTypeBankTransfer = "bank_transfer" // 银行转账 + PayTypeManual = "manual" // 人工支付 +) + +var ( + PayTypeSlice = []string{ + PayTypeWxPay, PayTypeAliPay, PayTypeQQPay, PayTypeBalance, PayTypeBankTransfer, PayTypeManual, + } + + PayTypeNameMap = map[string]string{ + PayTypeALL: "全部", + PayTypeWxPay: "微信支付", + PayTypeAliPay: "支付宝", + PayTypeQQPay: "QQ支付", + PayTypeBalance: "余额支付", + PayTypeBankTransfer: "银行转账", + PayTypeManual: "人工支付", + } +) + +// 交易方式 + +const ( + // 微信 + TradeTypeWxMP = "mp" // 公众号 + TradeTypeWxMini = "mini" // 小程序 + TradeTypeWxApp = "app" // APP + TradeTypeWxScan = "scan" // 二维码扫码 + TradeTypeWxPos = "pos" // 二维码收款 + TradeTypeWxH5 = "h5" // H5 + + // 支付宝 + TradeTypeAliWeb = "web" // 电脑网页 + TradeTypeAliApp = "app" // APP + TradeTypeAliScan = "scan" // 二维码扫码 + TradeTypeAliWap = "wap" // 手机网页 + TradeTypeAliPos = "pos" // 二维码收款 + + // QQ + TradeTypeQQWeb = "qqweb" // PC网页 + TradeTypeQQWap = "qqwap" // 移动端 +) + +var ( + TradeTypeWxSlice = []string{TradeTypeWxMP, TradeTypeWxMini, TradeTypeWxApp, TradeTypeWxScan, TradeTypeWxPos, TradeTypeWxH5} + TradeTypeAliSlice = []string{TradeTypeAliWeb, TradeTypeAliApp, TradeTypeAliScan, TradeTypeAliWap, TradeTypeAliPos} + TradeTypeQQSlice = []string{TradeTypeQQWeb, TradeTypeQQWap} +) + +// 支付状态 + +const ( + PayStatusWait = 1 // 待支付 + PayStatusOk = 2 // 已支付 +) + +// PayStatusOptions 支付状态选项 +var PayStatusOptions = []*model.Option{ + dict.GenDefaultOption(PayStatusWait, "待支付"), + dict.GenSuccessOption(PayStatusOk, "已支付"), +} + +// 退款状态 + +const ( + RefundStatusNo = 1 // 未退款 + RefundStatusApply = 2 // 申请退款 + RefundStatusReject = 3 // 拒绝退款 + RefundStatusAgree = 4 // 同意退款,已退款 +) + +// PayTypeOptions 支付方式选项 +var PayTypeOptions = []*model.Option{ + dict.GenSuccessOption(PayTypeWxPay, "微信支付"), + dict.GenInfoOption(PayTypeAliPay, "支付宝"), + dict.GenDefaultOption(PayTypeQQPay, "QQ支付"), + dict.GenPrimaryOption(PayTypeBalance, "余额支付"), + dict.GenInfoOption(PayTypeBankTransfer, "银行转账"), + dict.GenWarningOption(PayTypeManual, "人工支付"), +} diff --git a/server/internal/consts/portal.go b/server/internal/consts/portal.go new file mode 100644 index 0000000..057a17c --- /dev/null +++ b/server/internal/consts/portal.go @@ -0,0 +1,70 @@ +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +const ( + BizPublishDraft = 1 + BizPublishPending = 2 + BizPublishPublished = 3 + BizPublishOffline = 4 + BizPublishArchived = 5 + + BannerTargetNone = 1 + BannerTargetInternal = 2 + BannerTargetExternal = 3 + + ProductTypeStandard = 1 + ProductTypeManual = 2 + + SiteFeatureEnabled = 1 + SiteFeatureDisabled = 2 + + SiteProductModeProduct = 1 + SiteProductModeCreditCard = 2 +) + +var BizPublishStatusOptions = []*model.Option{ + dict.GenInfoOption(BizPublishDraft, "草稿"), + dict.GenWarningOption(BizPublishPending, "待审"), + dict.GenSuccessOption(BizPublishPublished, "已发布"), + dict.GenDefaultOption(BizPublishOffline, "已下线"), + dict.GenDefaultOption(BizPublishArchived, "已归档"), +} + +var BannerTargetTypeOptions = []*model.Option{ + dict.GenDefaultOption(BannerTargetNone, "无跳转"), + dict.GenPrimaryOption(BannerTargetInternal, "内部路由"), + dict.GenInfoOption(BannerTargetExternal, "外部链接"), +} + +var BannerPositionOptions = []*model.Option{ + dict.GenPrimaryOption("home_top", "首页顶部"), + dict.GenInfoOption("home_popup", "首页弹窗"), +} + +var ProductTypeOptions = []*model.Option{ + dict.GenPrimaryOption(ProductTypeStandard, "标准商品"), + dict.GenInfoOption(ProductTypeManual, "手工商城商品"), +} + +var SiteFeatureSwitchOptions = []*model.Option{ + dict.GenSuccessOption(SiteFeatureEnabled, "开启"), + dict.GenDefaultOption(SiteFeatureDisabled, "关闭"), +} + +var SiteProductModeOptions = []*model.Option{ + dict.GenPrimaryOption(SiteProductModeProduct, "商品"), + dict.GenInfoOption(SiteProductModeCreditCard, "信用卡"), +} + +func init() { + dict.RegisterEnums("bizPublishStatus", "业务发布状态", BizPublishStatusOptions) + dict.RegisterEnums("bannerTargetType", "Banner跳转类型", BannerTargetTypeOptions) + dict.RegisterEnums("bannerPosition", "Banner投放位置", BannerPositionOptions) + dict.RegisterEnums("productType", "商品类型", ProductTypeOptions) + dict.RegisterEnums("siteFeatureSwitch", "站点功能开关", SiteFeatureSwitchOptions) + dict.RegisterEnums("siteProductMode", "站点商城模式", SiteProductModeOptions) +} diff --git a/server/internal/consts/product_task.go b/server/internal/consts/product_task.go new file mode 100644 index 0000000..d68e71a --- /dev/null +++ b/server/internal/consts/product_task.go @@ -0,0 +1,26 @@ +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +const ( + TaskSubmissionPending = 1 + TaskSubmissionApproved = 2 + TaskSubmissionRejected = 3 + TaskSubmissionSettled = 4 + TaskSubmissionReversed = 5 +) + +var TaskSubmissionStatusOptions = []*model.Option{ + dict.GenWarningOption(TaskSubmissionPending, "待审核"), + dict.GenPrimaryOption(TaskSubmissionApproved, "已通过"), + dict.GenErrorOption(TaskSubmissionRejected, "已驳回"), + dict.GenSuccessOption(TaskSubmissionSettled, "已结算"), + dict.GenDefaultOption(TaskSubmissionReversed, "已冲正"), +} + +func init() { + dict.RegisterEnums("taskSubmissionStatus", "会员任务审核状态", TaskSubmissionStatusOptions) +} diff --git a/server/internal/consts/pubsub.go b/server/internal/consts/pubsub.go new file mode 100644 index 0000000..eff5e9c --- /dev/null +++ b/server/internal/consts/pubsub.go @@ -0,0 +1,12 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +const ( + ClusterSyncSysconfig = "cluster.sync.sysConfig" // 系统配置 + ClusterSyncSysBlacklist = "cluster.sync.sysBlacklist" // 系统黑名单 + ClusterSyncSysSuperAdmin = "cluster.sync.superAdmin" // 超管 +) diff --git a/server/internal/consts/queue.go b/server/internal/consts/queue.go new file mode 100644 index 0000000..d105f6b --- /dev/null +++ b/server/internal/consts/queue.go @@ -0,0 +1,14 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// +package consts + +// 消息队列 +const ( + QueueLogTopic = `request_log` // 访问日志 + QueueLoginLogTopic = `login_log` // 登录日志 + QueueServeLogTopic = `serve_log` // 服务日志 +) diff --git a/server/internal/consts/role.go b/server/internal/consts/role.go new file mode 100644 index 0000000..eb2e846 --- /dev/null +++ b/server/internal/consts/role.go @@ -0,0 +1,90 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 数据范围 +const ( + RoleDataAll = 1 // 全部权限 + + // 通过部门划分 + RoleDataNowDept = 2 // 当前部门 + RoleDataDeptAndSub = 3 // 当前部门及以下部门 + RoleDataDeptCustom = 4 // 自定义部门 + + // 通过上下级关系划分 + RoleDataSelf = 5 // 仅自己 + RoleDataSelfAndSub = 6 // 自己和直属下级 + RoleDataSelfAndAllSub = 7 // 自己和全部下级 +) + +var RoleDataNameMap = map[int]string{ + RoleDataAll: "全部权限", + RoleDataNowDept: "当前部门", + RoleDataDeptAndSub: "当前及以下部门", + RoleDataDeptCustom: "自定义部门", + RoleDataSelf: "仅自己", + RoleDataSelfAndSub: "自己和直属下级", + RoleDataSelfAndAllSub: "自己和全部下级", +} + +type GroupScopeSelect struct { + Type string `json:"type,omitempty"` + Label string `json:"label"` + Key int `json:"key"` + Value int `json:"value,omitempty"` + Children []ScopeSelect `json:"children,omitempty"` +} + +type ScopeSelect struct { + Label string `json:"label"` + Value int `json:"value"` +} + +var DataScopeSelect = []GroupScopeSelect{ + { + Label: RoleDataNameMap[RoleDataAll], + Key: RoleDataAll, + Value: RoleDataAll, + }, + { + Type: "group", + Label: "按部门划分", + Key: -1, + Children: []ScopeSelect{ + { + Label: RoleDataNameMap[RoleDataNowDept], + Value: RoleDataNowDept, + }, + { + Label: RoleDataNameMap[RoleDataDeptAndSub], + Value: RoleDataDeptAndSub, + }, + { + Label: RoleDataNameMap[RoleDataDeptCustom], + Value: RoleDataDeptCustom, + }, + }, + }, + { + Type: "group", + Label: "按上下级关系划分", + Key: -2, + Children: []ScopeSelect{ + { + Label: RoleDataNameMap[RoleDataSelf], + Value: RoleDataSelf, + }, + { + Label: RoleDataNameMap[RoleDataSelfAndSub], + Value: RoleDataSelfAndSub, + }, + { + Label: RoleDataNameMap[RoleDataSelfAndAllSub], + Value: RoleDataSelfAndAllSub, + }, + }, + }, +} diff --git a/server/internal/consts/servelicense.go b/server/internal/consts/servelicense.go new file mode 100644 index 0000000..96e9dc8 --- /dev/null +++ b/server/internal/consts/servelicense.go @@ -0,0 +1,29 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +func init() { + dict.RegisterEnums("ServerLicenseGroupOptions", "服务授权分组选项", ServerLicenseGroupOptions) +} + +// 授权分组 +const ( + LicenseGroupDefault = "default" // 默认组 + LicenseGroupCron = "cron" // 定时任务 + LicenseGroupAuth = "auth" // 服务授权 +) + +// ServerLicenseGroupOptions 服务授权分组选项 +var ServerLicenseGroupOptions = []*model.Option{ + dict.GenWarningOption(LicenseGroupDefault, "默认组"), + dict.GenSuccessOption(LicenseGroupCron, "定时任务"), + dict.GenSuccessOption(LicenseGroupAuth, "服务授权"), +} diff --git a/server/internal/consts/sms.go b/server/internal/consts/sms.go new file mode 100644 index 0000000..2836e24 --- /dev/null +++ b/server/internal/consts/sms.go @@ -0,0 +1,33 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 短信驱动 +const ( + SmsDriveAliYun = "aliyun" // 阿里云 + SmsDriveTencent = "tencent" // 腾讯云 +) + +// 短信内置模板 +const ( + SmsTemplateCode = "code" // 通用验证码 + SmsTemplateLogin = "login" // 登录 + SmsTemplateRegister = "register" // 注册 + SmsTemplateResetPwd = "resetPwd" // 重置密码 + SmsTemplateBind = "bind" // 绑定手机号 + SmsTemplateCash = "cash" // 申请提现 +) + +var ( + SmsTemplateEventMap = map[string]string{ + SmsTemplateCode: "通用验证码", + SmsTemplateLogin: "登录", + SmsTemplateRegister: "注册", + SmsTemplateResetPwd: "重置密码", + SmsTemplateBind: "绑定手机号", + SmsTemplateCash: "申请提现", + } +) diff --git a/server/internal/consts/status.go b/server/internal/consts/status.go new file mode 100644 index 0000000..eb379f9 --- /dev/null +++ b/server/internal/consts/status.go @@ -0,0 +1,49 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +func init() { + dict.RegisterEnums("CodeStatusOptions", "验证码状态选项", CodeStatusOptions) + dict.RegisterEnums("BlacklistStatusOptions", "黑名单拉黑状态选项", BlacklistStatusOptions) +} + +// 状态码 +const ( + StatusALL int = -1 // 全部状态 + StatusEnabled int = 1 // 启用 + StatusDisable int = 2 // 禁用 + StatusDelete int = 3 // 已删除 +) + +var StatusSlice = []int{StatusALL, StatusEnabled, StatusDisable, StatusDelete} + +// 验证码状态 +const ( + CodeStatusNotUsed = 1 // 未使用 + CodeStatusUsed = 2 // 已使用 +) + +// CodeStatusOptions 验证码状态选项 +var CodeStatusOptions = []*model.Option{ + dict.GenWarningOption(CodeStatusNotUsed, "未使用"), + dict.GenSuccessOption(CodeStatusUsed, "已使用"), +} + +const ( + BlacklistStatusDisable = 1 // 封禁中 + BlacklistStatusEnabled = 2 // 已解封 +) + +// BlacklistStatusOptions 黑名单拉黑状态选项 +var BlacklistStatusOptions = []*model.Option{ + dict.GenWarningOption(BlacklistStatusDisable, "封禁中"), + dict.GenSuccessOption(BlacklistStatusEnabled, "已解封"), +} diff --git a/server/internal/consts/trade.go b/server/internal/consts/trade.go new file mode 100644 index 0000000..6cfad34 --- /dev/null +++ b/server/internal/consts/trade.go @@ -0,0 +1,122 @@ +package consts + +import ( + "hotgo/internal/library/dict" + "hotgo/internal/model" +) + +const ( + TradeOrderTypeProduct = 1 + TradeOrderTypeTask = 2 + TradeOrderTypeManual = 3 + + TradeOrderMatching = 1 + TradeOrderPending = 2 + TradeOrderProcessing = 3 + TradeOrderCompleted = 4 + TradeOrderTimeout = 5 + TradeOrderFrozen = 6 + TradeOrderCancelled = 7 + TradeOrderFailed = 8 + + TradeFreezeNormal = 1 + TradeFreezeFrozen = 2 + TradeFreezePending = 3 + + TradeActionCancelMatch = "cancel_match" + TradeActionRematch = "rematch" + TradeActionUnfreeze = "unfreeze" + + RechargeTypeOnline = 1 + RechargeTypeManual = 2 + + RechargeUnpaid = 1 + RechargeReview = 2 + RechargeSuccess = 3 + RechargeRejected = 4 + RechargeExpired = 5 + RechargeCancelled = 6 + + WithdrawalPending = 1 + WithdrawalReviewing = 2 + WithdrawalProcessing = 3 + WithdrawalSuccess = 4 + WithdrawalFailed = 5 + WithdrawalRejected = 6 + WithdrawalCancelled = 7 + + FinanceDecisionApprove = 1 + FinanceDecisionReject = 2 + + CustomerServiceOnline = 1 + CustomerServiceOffline = 2 + + TradeAutoDispatchEnabled = 1 + TradeAutoDispatchDisabled = 2 +) + +var TradeOrderTypeOptions = []*model.Option{ + dict.GenPrimaryOption(TradeOrderTypeProduct, "商品订单"), + dict.GenInfoOption(TradeOrderTypeTask, "任务订单"), + dict.GenDefaultOption(TradeOrderTypeManual, "手工商城"), +} +var TradeOrderStatusOptions = []*model.Option{ + dict.GenInfoOption(TradeOrderMatching, "匹配中"), + dict.GenWarningOption(TradeOrderPending, "待处理"), + dict.GenPrimaryOption(TradeOrderProcessing, "处理中"), + dict.GenSuccessOption(TradeOrderCompleted, "已完成"), + dict.GenWarningOption(TradeOrderTimeout, "已超时"), + dict.GenErrorOption(TradeOrderFrozen, "已冻结"), + dict.GenDefaultOption(TradeOrderCancelled, "已取消"), + dict.GenErrorOption(TradeOrderFailed, "失败"), +} +var TradeFreezeStatusOptions = []*model.Option{ + dict.GenSuccessOption(TradeFreezeNormal, "正常"), + dict.GenErrorOption(TradeFreezeFrozen, "已冻结"), + dict.GenWarningOption(TradeFreezePending, "解冻复核中"), +} +var RechargeTypeOptions = []*model.Option{ + dict.GenPrimaryOption(RechargeTypeOnline, "线上支付"), + dict.GenInfoOption(RechargeTypeManual, "人工充值"), +} +var RechargeStatusOptions = []*model.Option{ + dict.GenDefaultOption(RechargeUnpaid, "用户未支付"), + dict.GenWarningOption(RechargeReview, "手动审核"), + dict.GenSuccessOption(RechargeSuccess, "已入账"), + dict.GenErrorOption(RechargeRejected, "手动驳回"), + dict.GenDefaultOption(RechargeExpired, "已过期"), + dict.GenDefaultOption(RechargeCancelled, "已取消"), +} +var WithdrawalStatusOptions = []*model.Option{ + dict.GenWarningOption(WithdrawalPending, "待初审"), + dict.GenWarningOption(WithdrawalReviewing, "复核中"), + dict.GenPrimaryOption(WithdrawalProcessing, "付款中"), + dict.GenSuccessOption(WithdrawalSuccess, "已到账"), + dict.GenErrorOption(WithdrawalFailed, "付款失败"), + dict.GenErrorOption(WithdrawalRejected, "已驳回"), + dict.GenDefaultOption(WithdrawalCancelled, "已取消"), +} +var FinanceDecisionOptions = []*model.Option{ + dict.GenSuccessOption(FinanceDecisionApprove, "通过"), + dict.GenErrorOption(FinanceDecisionReject, "驳回"), +} +var CustomerServiceOnlineOptions = []*model.Option{ + dict.GenSuccessOption(CustomerServiceOnline, "在线"), + dict.GenDefaultOption(CustomerServiceOffline, "离线"), +} +var TradeAutoDispatchOptions = []*model.Option{ + dict.GenSuccessOption(TradeAutoDispatchEnabled, "自动派单"), + dict.GenDefaultOption(TradeAutoDispatchDisabled, "手动领取"), +} + +func init() { + dict.RegisterEnums("tradeOrderType", "交易订单类型", TradeOrderTypeOptions) + dict.RegisterEnums("tradeOrderStatus", "交易订单状态", TradeOrderStatusOptions) + dict.RegisterEnums("tradeFreezeStatus", "交易冻结状态", TradeFreezeStatusOptions) + dict.RegisterEnums("rechargeType", "充值类型", RechargeTypeOptions) + dict.RegisterEnums("rechargeStatus", "充值状态", RechargeStatusOptions) + dict.RegisterEnums("withdrawalStatus", "提现状态", WithdrawalStatusOptions) + dict.RegisterEnums("financeDecision", "财务审核结论", FinanceDecisionOptions) + dict.RegisterEnums("customerServiceOnline", "客服在线状态", CustomerServiceOnlineOptions) + dict.RegisterEnums("tradeAutoDispatch", "交易派单方式", TradeAutoDispatchOptions) +} diff --git a/server/internal/consts/upload.go b/server/internal/consts/upload.go new file mode 100644 index 0000000..b760381 --- /dev/null +++ b/server/internal/consts/upload.go @@ -0,0 +1,16 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 上传存储驱动 +const ( + UploadDriveLocal = "local" // 本地驱动 + UploadDriveUCloud = "ucloud" // ucloud对象存储 + UploadDriveCos = "cos" // 腾讯云cos + UploadDriveOss = "oss" // 阿里云oss + UploadDriveQiNiu = "qiniu" // 七牛云对象存储 + UploadDriveMinio = "minio" // minio对象存储 +) diff --git a/server/internal/consts/version.go b/server/internal/consts/version.go new file mode 100644 index 0000000..0c77457 --- /dev/null +++ b/server/internal/consts/version.go @@ -0,0 +1,11 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2025 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// VersionApp HotGo版本 +const ( + VersionApp = "2.18.9" +) diff --git a/server/internal/consts/wechat.go b/server/internal/consts/wechat.go new file mode 100644 index 0000000..54565fd --- /dev/null +++ b/server/internal/consts/wechat.go @@ -0,0 +1,18 @@ +// Package consts +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package consts + +// 授权类型 +const ( + WechatAuthorizeOpenId = "openId" // 设置openid + WechatAuthorizeBindLogin = "bindLogin" // 绑定微信登录 +) + +// 应用授权作用域 +const ( + WechatScopeBase = "snsapi_base" // 只获取openid,无需用户授权 + WechatScopeUserinfo = "snsapi_userinfo" // 获取用户信息,需要授权 +) diff --git a/server/internal/controller/admin/admin/cash.go b/server/internal/controller/admin/admin/cash.go new file mode 100644 index 0000000..124b034 --- /dev/null +++ b/server/internal/controller/admin/admin/cash.go @@ -0,0 +1,60 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "hotgo/api/admin/cash" + "hotgo/internal/library/contexts" + "hotgo/internal/model/input/adminin" + "hotgo/internal/service" +) + +var ( + Cash = cCash{} +) + +type cCash struct{} + +// View 获取指定信息 +func (c *cCash) View(ctx context.Context, req *cash.ViewReq) (res *cash.ViewRes, err error) { + data, err := service.AdminCash().View(ctx, &req.CashViewInp) + if err != nil { + return + } + + res = new(cash.ViewRes) + res.CashViewModel = data + return +} + +// List 查看列表 +func (c *cCash) List(ctx context.Context, req *cash.ListReq) (res *cash.ListRes, err error) { + list, totalCount, err := service.AdminCash().List(ctx, &req.CashListInp) + if err != nil { + return + } + + res = new(cash.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Apply 申请提现 +func (c *cCash) Apply(ctx context.Context, req *cash.ApplyReq) (res *cash.ApplyRes, err error) { + err = service.AdminCash().Apply(ctx, &adminin.CashApplyInp{ + Money: req.Money, + MemberId: contexts.GetUserId(ctx), + }) + return +} + +// Payment 提现打款处理 +func (c *cCash) Payment(ctx context.Context, req *cash.PaymentReq) (res *cash.PaymentRes, err error) { + err = service.AdminCash().Payment(ctx, &req.CashPaymentInp) + return +} diff --git a/server/internal/controller/admin/admin/credits_log.go b/server/internal/controller/admin/admin/credits_log.go new file mode 100644 index 0000000..003fc82 --- /dev/null +++ b/server/internal/controller/admin/admin/credits_log.go @@ -0,0 +1,39 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +// @AutoGenerate Version 2.5.3 +// @AutoGenerate Date 2023-04-15 15:59:58 +package admin + +import ( + "context" + "hotgo/api/admin/creditslog" + "hotgo/internal/service" +) + +var ( + CreditsLog = cCreditsLog{} +) + +type cCreditsLog struct{} + +// List 查看资产变动列表 +func (c *cCreditsLog) List(ctx context.Context, req *creditslog.ListReq) (res *creditslog.ListRes, err error) { + list, totalCount, err := service.AdminCreditsLog().List(ctx, &req.CreditsLogListInp) + if err != nil { + return + } + + res = new(creditslog.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出资产变动列表 +func (c *cCreditsLog) Export(ctx context.Context, req *creditslog.ExportReq) (res *creditslog.ExportRes, err error) { + err = service.AdminCreditsLog().Export(ctx, &req.CreditsLogListInp) + return +} diff --git a/server/internal/controller/admin/admin/dept.go b/server/internal/controller/admin/admin/dept.go new file mode 100644 index 0000000..5730ce6 --- /dev/null +++ b/server/internal/controller/admin/admin/dept.go @@ -0,0 +1,75 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "hotgo/api/admin/dept" + "hotgo/internal/service" +) + +var ( + Dept = cDept{} +) + +type cDept struct{} + +// Delete 删除 +func (c *cDept) Delete(ctx context.Context, req *dept.DeleteReq) (res *dept.DeleteRes, err error) { + err = service.AdminDept().Delete(ctx, &req.DeptDeleteInp) + return +} + +// Edit 更新 +func (c *cDept) Edit(ctx context.Context, req *dept.EditReq) (res *dept.EditRes, err error) { + err = service.AdminDept().Edit(ctx, &req.DeptEditInp) + return +} + +// MaxSort 最大排序 +func (c *cDept) MaxSort(ctx context.Context, req *dept.MaxSortReq) (res *dept.MaxSortRes, err error) { + res = new(dept.MaxSortRes) + res.DeptMaxSortModel, err = service.AdminDept().MaxSort(ctx, &req.DeptMaxSortInp) + return +} + +// View 获取指定信息 +func (c *cDept) View(ctx context.Context, req *dept.ViewReq) (res *dept.ViewRes, err error) { + res = new(dept.ViewRes) + res.DeptViewModel, err = service.AdminDept().View(ctx, &req.DeptViewInp) + return +} + +// List 查看列表 +func (c *cDept) List(ctx context.Context, req *dept.ListReq) (res *dept.ListRes, err error) { + data, err := service.AdminDept().List(ctx, &req.DeptListInp) + if err != nil || data == nil { + return + } + + res = (*dept.ListRes)(&data) + return +} + +// Option 获取部门选项树 +func (c *cDept) Option(ctx context.Context, req *dept.OptionReq) (res *dept.OptionRes, err error) { + list, totalCount, err := service.AdminDept().Option(ctx, &req.DeptOptionInp) + if err != nil { + return + } + + res = new(dept.OptionRes) + res.DeptOptionModel = list + res.PageRes.Pack(req, totalCount) + return +} + +// TreeOption 获取部门管理关系树选项 +func (c *cDept) TreeOption(ctx context.Context, req *dept.TreeOptionReq) (res *dept.TreeOptionRes, err error) { + data, err := service.AdminDept().TreeOption(ctx) + res = (*dept.TreeOptionRes)(&data) + return +} diff --git a/server/internal/controller/admin/admin/member.go b/server/internal/controller/admin/admin/member.go new file mode 100644 index 0000000..6724e58 --- /dev/null +++ b/server/internal/controller/admin/admin/member.go @@ -0,0 +1,145 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "hotgo/api/admin/member" + "hotgo/internal/library/contexts" + "hotgo/internal/model/input/adminin" + "hotgo/internal/service" +) + +var ( + Member = cMember{} +) + +type cMember struct{} + +// UpdateCash 修改代理商提现信息 +func (c *cMember) UpdateCash(ctx context.Context, req *member.UpdateCashReq) (res *member.UpdateCashRes, err error) { + err = service.AdminMember().UpdateCash(ctx, &req.MemberUpdateCashInp) + return +} + +// UpdateEmail 换绑邮箱 +func (c *cMember) UpdateEmail(ctx context.Context, req *member.UpdateEmailReq) (res *member.UpdateEmailRes, err error) { + err = service.AdminMember().UpdateEmail(ctx, &req.MemberUpdateEmailInp) + return +} + +// UpdateMobile 换绑手机号 +func (c *cMember) UpdateMobile(ctx context.Context, req *member.UpdateMobileReq) (res *member.UpdateMobileRes, err error) { + err = service.AdminMember().UpdateMobile(ctx, &req.MemberUpdateMobileInp) + return +} + +// UpdateProfile 更新用户资料 +func (c *cMember) UpdateProfile(ctx context.Context, req *member.UpdateProfileReq) (res *member.UpdateProfileRes, err error) { + err = service.AdminMember().UpdateProfile(ctx, &req.MemberUpdateProfileInp) + return +} + +// UpdatePwd 修改登录密码 +func (c *cMember) UpdatePwd(ctx context.Context, req *member.UpdatePwdReq) (res *member.UpdatePwdRes, err error) { + var memberId = contexts.Get(ctx).User.Id + if memberId <= 0 { + err = gerror.New("获取用户信息失败!") + return + } + + err = service.AdminMember().UpdatePwd(ctx, &adminin.MemberUpdatePwdInp{ + Id: memberId, + OldPassword: req.OldPassword, + NewPassword: req.NewPassword, + }) + return +} + +// ResetPwd 重置密码 +func (c *cMember) ResetPwd(ctx context.Context, req *member.ResetPwdReq) (res *member.ResetPwdRes, err error) { + err = service.AdminMember().ResetPwd(ctx, &req.MemberResetPwdInp) + return +} + +// MemberInfo 登录用户信息 +func (c *cMember) MemberInfo(ctx context.Context, _ *member.InfoReq) (res *member.InfoRes, err error) { + data, err := service.AdminMember().LoginMemberInfo(ctx) + if err != nil { + return + } + + res = new(member.InfoRes) + res.LoginMemberInfoModel = data + return +} + +// Delete 删除用户 +func (c *cMember) Delete(ctx context.Context, req *member.DeleteReq) (res *member.DeleteRes, err error) { + err = service.AdminMember().Delete(ctx, &req.MemberDeleteInp) + return +} + +// Edit 修改/新增用户 +func (c *cMember) Edit(ctx context.Context, req *member.EditReq) (res *member.EditRes, err error) { + err = service.AdminMember().Edit(ctx, &req.MemberEditInp) + return +} + +// View 获取指定用户信息 +func (c *cMember) View(ctx context.Context, req *member.ViewReq) (res *member.ViewRes, err error) { + data, err := service.AdminMember().View(ctx, &req.MemberViewInp) + if err != nil { + return + } + + res = new(member.ViewRes) + res.MemberViewModel = data + return +} + +// List 查看用户列表 +func (c *cMember) List(ctx context.Context, req *member.ListReq) (res *member.ListRes, err error) { + list, totalCount, err := service.AdminMember().List(ctx, &req.MemberListInp) + if err != nil { + return + } + + res = new(member.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新用户状态 +func (c *cMember) Status(ctx context.Context, req *member.StatusReq) (res *member.StatusRes, err error) { + err = service.AdminMember().Status(ctx, &req.MemberStatusInp) + return +} + +// Select 获取可选的后台用户选项 +func (c *cMember) Select(ctx context.Context, req *member.SelectReq) (res *member.SelectRes, err error) { + data, err := service.AdminMember().Select(ctx, &req.MemberSelectInp) + if err != nil { + return + } + + res = (*member.SelectRes)(&data) + return +} + +// AddBalance 增加用户余额 +func (c *cMember) AddBalance(ctx context.Context, req *member.AddBalanceReq) (res *member.AddBalanceRes, err error) { + err = service.AdminMember().AddBalance(ctx, &req.MemberAddBalanceInp) + return +} + +// AddIntegral 增加用户积分 +func (c *cMember) AddIntegral(ctx context.Context, req *member.AddIntegralReq) (res *member.AddIntegralRes, err error) { + err = service.AdminMember().AddIntegral(ctx, &req.MemberAddIntegralInp) + return +} diff --git a/server/internal/controller/admin/admin/menu.go b/server/internal/controller/admin/admin/menu.go new file mode 100644 index 0000000..3bd2de5 --- /dev/null +++ b/server/internal/controller/admin/admin/menu.go @@ -0,0 +1,37 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "hotgo/api/admin/menu" + "hotgo/internal/service" +) + +// Menu 菜单 +var ( + Menu = cMenu{} +) + +type cMenu struct{} + +// Delete 删除 +func (c *cMenu) Delete(ctx context.Context, req *menu.DeleteReq) (res *menu.DeleteRes, err error) { + err = service.AdminMenu().Delete(ctx, &req.MenuDeleteInp) + return +} + +// Edit 更新 +func (c *cMenu) Edit(ctx context.Context, req *menu.EditReq) (res *menu.EditRes, err error) { + err = service.AdminMenu().Edit(ctx, &req.MenuEditInp) + return +} + +// List 获取列表 +func (c *cMenu) List(ctx context.Context, req *menu.ListReq) (res menu.ListRes, err error) { + res.MenuListModel, err = service.AdminMenu().List(ctx, &req.MenuListInp) + return +} diff --git a/server/internal/controller/admin/admin/monitor.go b/server/internal/controller/admin/admin/monitor.go new file mode 100644 index 0000000..2a8a936 --- /dev/null +++ b/server/internal/controller/admin/admin/monitor.go @@ -0,0 +1,243 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "github.com/gogf/gf/v2/os/gtime" + "github.com/gogf/gf/v2/text/gstr" + "hotgo/api/admin/monitor" + "hotgo/internal/consts" + "hotgo/internal/dao" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/form" + "hotgo/internal/service" + "hotgo/internal/websocket" + "hotgo/utility/simple" + "hotgo/utility/useragent" + "sort" +) + +// Monitor 监控 +var Monitor = cMonitor{ + wsManager: websocket.Manager(), +} + +type cMonitor struct { + wsManager *websocket.ClientManager +} + +// UserOffline 下线用户 +func (c *cMonitor) UserOffline(ctx context.Context, req *monitor.UserOfflineReq) (res *monitor.UserOfflineRes, err error) { + client := c.wsManager.GetClient(req.Id) + if client == nil { + err = gerror.New("客户端已离线") + return + } + + simple.SafeGo(ctx, func(ctx context.Context) { + websocket.SendSuccess(client, "kick") + websocket.Close(client) + }) + return +} + +// UserOnlineList 获取用户在线列表 +func (c *cMonitor) UserOnlineList(ctx context.Context, req *monitor.UserOnlineListReq) (res *monitor.UserOnlineListRes, err error) { + var ( + clients []*monitor.UserOnlineModel + i int + ) + + if c.wsManager.GetClientsLen() == 0 { + return + } + + for conn := range c.wsManager.GetClients() { + if conn.SendClose || conn.User == nil { + continue + } + + if req.UserId > 0 && req.UserId != conn.User.Id { + continue + } + + if req.Username != "" && req.Username != conn.User.Username { + continue + } + + if req.IP != "" && !gstr.Contains(conn.IP, req.IP) { + continue + } + + if len(req.FirstTime) == 2 && (conn.User.LoginAt.Before(req.FirstTime[0]) || conn.User.LoginAt.After(req.FirstTime[1])) { + continue + } + + clients = append(clients, &monitor.UserOnlineModel{ + ID: conn.ID, + IP: conn.IP, + Os: useragent.GetOs(conn.UserAgent), + Browser: useragent.GetBrowser(conn.UserAgent), + FirstTime: conn.User.LoginAt.Unix(), + HeartbeatTime: conn.HeartbeatTime, + App: conn.User.App, + UserId: conn.User.Id, + Username: conn.User.Username, + Avatar: conn.User.Avatar, + }) + } + + res = new(monitor.UserOnlineListRes) + res.PageRes.Pack(req, len(clients)) + + sort.Slice(clients, func(i, j int) bool { + if clients[i].FirstTime == clients[j].FirstTime { + return clients[i].ID < clients[j].ID + } + return clients[i].FirstTime < clients[j].FirstTime + }) + + _, perPage, offset := form.CalPage(req.Page, req.PerPage) + for k, v := range clients { + if k >= offset && i <= perPage { + if simple.IsDemo(ctx) { + v.IP = consts.DemoTips + } + res.List = append(res.List, v) + i++ + } + } + return +} + +// NetOnlineList 获取服务在线列表 +func (c *cMonitor) NetOnlineList(ctx context.Context, req *monitor.NetOnlineListReq) (res *monitor.NetOnlineListRes, err error) { + var ( + clients []*monitor.NetOnlineModel + i int + cols = dao.SysServeLicense.Columns() + serv = service.TCPServer().Instance() + models *entity.SysServeLicense + ) + + conns := serv.GetClients() + if len(conns) == 0 { + res = new(monitor.NetOnlineListRes) + res.PageRes.Pack(req, 0) + return + } + + for _, conn := range conns { + v := &monitor.NetOnlineModel{ + AuthMeta: conn.Auth, + Id: conn.CID, + IsAuth: conn.Auth != nil, + Addr: conn.RemoteAddr().String(), + Port: gstr.SubStrFromEx(conn.LocalAddr().String(), `:`), + FirstTime: conn.FirstTime, + HeartbeatTime: conn.Heartbeat, + Proto: "TCP", + } + + if v.IsAuth { + if err = dao.SysServeLicense.Ctx(ctx).Where(cols.Appid, conn.Auth.AppId).Where(cols.Group, conn.Auth.Group).Scan(&models); err != nil { + return + } + + if models == nil { + continue + } + + v.LicenseId = models.Id + v.LicenseName = models.Name + v.LoginTimes = models.LoginTimes + v.Online = serv.GetAppIdOnline(models.Appid) + v.OnlineLimit = models.OnlineLimit + } + + if req.Addr != "" && !gstr.Contains(v.Addr, req.Addr) { + continue + } + + if req.Name != "" && !gstr.Contains(v.Name, req.Name) { + continue + } + + if req.Group != "" && (!v.IsAuth || v.Group != req.Group) { + continue + } + + if req.AppId != "" && (!v.IsAuth || v.AppId != req.AppId) { + continue + } + + ft := gtime.New(conn.FirstTime) + if len(req.FirstTime) == 2 && (ft.Before(req.FirstTime[0]) || ft.After(req.FirstTime[1])) { + continue + } + clients = append(clients, v) + } + + res = new(monitor.NetOnlineListRes) + res.PageRes.Pack(req, len(clients)) + + sort.Slice(clients, func(i, j int) bool { + return clients[i].Id > clients[j].Id + }) + + _, perPage, offset := form.CalPage(req.Page, req.PerPage) + for k, v := range clients { + if k >= offset && i <= perPage { + res.List = append(res.List, v) + i++ + } + } + return +} + +// NetOption 获取服务选项 +func (c *cMonitor) NetOption(ctx context.Context, req *monitor.NetOptionReq) (res *monitor.NetOptionRes, err error) { + res = new(monitor.NetOptionRes) + + for _, v := range service.TCPServer().Instance().GetRoutes() { + // 无需勾选的路由 + disabled := false + if v.Id == "ServerLoginReq" || v.Id == "ServerHeartbeatReq" { + disabled = true + } + + res.Routes = append(res.Routes, &monitor.RouteSelect{ + Value: v.Id, + Label: v.Id, + Disabled: disabled, + IsRPC: v.IsRPC, + }) + } + + sort.Slice(res.Routes, func(i, j int) bool { + if res.Routes[i].IsRPC && !res.Routes[j].IsRPC { + return true + } else if !res.Routes[i].IsRPC && res.Routes[j].IsRPC { + return false + } + return res.Routes[i].Label < res.Routes[j].Label + }) + return +} + +// NetOffline 下线服务 +func (c *cMonitor) NetOffline(ctx context.Context, req *monitor.NetOfflineReq) (res *monitor.NetOfflineRes, err error) { + conn := service.TCPServer().Instance().GetClientById(req.Id) + if conn == nil { + err = gerror.New("客户端不在线") + return + } + // 关闭连接 + conn.Close() + return +} diff --git a/server/internal/controller/admin/admin/notice.go b/server/internal/controller/admin/admin/notice.go new file mode 100644 index 0000000..068e71c --- /dev/null +++ b/server/internal/controller/admin/admin/notice.go @@ -0,0 +1,127 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "hotgo/api/admin/notice" + "hotgo/internal/consts" + "hotgo/internal/service" +) + +var ( + Notice = cNotice{} +) + +type cNotice struct{} + +// Delete 删除 +func (c *cNotice) Delete(ctx context.Context, req *notice.DeleteReq) (res *notice.DeleteRes, err error) { + err = service.AdminNotice().Delete(ctx, &req.NoticeDeleteInp) + return +} + +// Edit 更新 +func (c *cNotice) Edit(ctx context.Context, req *notice.EditReq) (res *notice.EditRes, err error) { + err = service.AdminNotice().Edit(ctx, &req.NoticeEditInp) + return +} + +// MaxSort 最大排序 +func (c *cNotice) MaxSort(ctx context.Context, req *notice.MaxSortReq) (res *notice.MaxSortRes, err error) { + res = new(notice.MaxSortRes) + res.NoticeMaxSortModel, err = service.AdminNotice().MaxSort(ctx, &req.NoticeMaxSortInp) + return +} + +// View 获取指定信息 +func (c *cNotice) View(ctx context.Context, req *notice.ViewReq) (res *notice.ViewRes, err error) { + data, err := service.AdminNotice().View(ctx, &req.NoticeViewInp) + if err != nil { + return + } + + res = new(notice.ViewRes) + res.NoticeViewModel = data + return +} + +// List 查看列表 +func (c *cNotice) List(ctx context.Context, req *notice.ListReq) (res *notice.ListRes, err error) { + list, totalCount, err := service.AdminNotice().List(ctx, &req.NoticeListInp) + if err != nil { + return nil, err + } + + res = new(notice.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新状态 +func (c *cNotice) Status(ctx context.Context, req *notice.StatusReq) (res *notice.StatusRes, err error) { + err = service.AdminNotice().Status(ctx, &req.NoticeStatusInp) + return +} + +// Notify 更新通知 +func (c *cNotice) Notify(ctx context.Context, req *notice.EditNotifyReq) (res *notice.EditNotifyRes, err error) { + req.Type = consts.NoticeTypeNotify + err = service.AdminNotice().Edit(ctx, &req.NoticeEditInp) + return +} + +// Notice 更新公告 +func (c *cNotice) Notice(ctx context.Context, req *notice.EditNoticeReq) (res *notice.EditNoticeRes, err error) { + req.Type = consts.NoticeTypeNotice + err = service.AdminNotice().Edit(ctx, &req.NoticeEditInp) + return +} + +// Letter 更新私信 +func (c *cNotice) Letter(ctx context.Context, req *notice.EditLetterReq) (res *notice.EditLetterRes, err error) { + req.Type = consts.NoticeTypeLetter + err = service.AdminNotice().Edit(ctx, &req.NoticeEditInp) + return +} + +// UpRead 更新已读 +func (c *cNotice) UpRead(ctx context.Context, req *notice.UpReadReq) (res *notice.UpReadRes, err error) { + err = service.AdminNotice().UpRead(ctx, &req.NoticeUpReadInp) + return +} + +// PullMessages 拉取未读消息列表 +func (c *cNotice) PullMessages(ctx context.Context, req *notice.PullMessagesReq) (res *notice.PullMessagesRes, err error) { + data, err := service.AdminNotice().PullMessages(ctx, &req.PullMessagesInp) + if err != nil { + return + } + + res = new(notice.PullMessagesRes) + res.PullMessagesModel = data + return +} + +// ReadAll 全部已读 +func (c *cNotice) ReadAll(ctx context.Context, req *notice.ReadAllReq) (res *notice.ReadAllRes, err error) { + err = service.AdminNotice().ReadAll(ctx, &req.NoticeReadAllInp) + return +} + +// MessageList 我的消息列表 +func (c *cNotice) MessageList(ctx context.Context, req *notice.MessageListReq) (res *notice.MessageListRes, err error) { + list, totalCount, err := service.AdminNotice().MessageList(ctx, &req.NoticeMessageListInp) + if err != nil { + return + } + + res = new(notice.MessageListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} diff --git a/server/internal/controller/admin/admin/order.go b/server/internal/controller/admin/admin/order.go new file mode 100644 index 0000000..5f6e2de --- /dev/null +++ b/server/internal/controller/admin/admin/order.go @@ -0,0 +1,91 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "hotgo/api/admin/order" + "hotgo/internal/service" +) + +var ( + Order = cOrder{} +) + +type cOrder struct{} + +// AcceptRefund 受理申请退款 +func (c *cOrder) AcceptRefund(ctx context.Context, req *order.AcceptRefundReq) (res *order.AcceptRefundRes, err error) { + err = service.AdminOrder().AcceptRefund(ctx, &req.OrderAcceptRefundInp) + return +} + +// ApplyRefund 申请退款 +func (c *cOrder) ApplyRefund(ctx context.Context, req *order.ApplyRefundReq) (res *order.ApplyRefundRes, err error) { + err = service.AdminOrder().ApplyRefund(ctx, &req.OrderApplyRefundInp) + return +} + +// Create 创建充值订单 +func (c *cOrder) Create(ctx context.Context, req *order.CreateReq) (res *order.CreateRes, err error) { + data, err := service.AdminOrder().Create(ctx, &req.OrderCreateInp) + if err != nil { + return + } + + res = new(order.CreateRes) + res.OrderCreateModel = data + return +} + +// List 查看充值订单列表 +func (c *cOrder) List(ctx context.Context, req *order.ListReq) (res *order.ListRes, err error) { + list, totalCount, err := service.AdminOrder().List(ctx, &req.OrderListInp) + if err != nil { + return + } + + res = new(order.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Export 导出充值订单列表 +func (c *cOrder) Export(ctx context.Context, req *order.ExportReq) (res *order.ExportRes, err error) { + err = service.AdminOrder().Export(ctx, &req.OrderListInp) + return +} + +// Edit 更新充值订单 +func (c *cOrder) Edit(ctx context.Context, req *order.EditReq) (res *order.EditRes, err error) { + err = service.AdminOrder().Edit(ctx, &req.OrderEditInp) + return +} + +// View 获取指定充值订单信息 +func (c *cOrder) View(ctx context.Context, req *order.ViewReq) (res *order.ViewRes, err error) { + data, err := service.AdminOrder().View(ctx, &req.OrderViewInp) + if err != nil { + return + } + + res = new(order.ViewRes) + res.OrderViewModel = data + return +} + +// Delete 删除充值订单 +func (c *cOrder) Delete(ctx context.Context, req *order.DeleteReq) (res *order.DeleteRes, err error) { + err = service.AdminOrder().Delete(ctx, &req.OrderDeleteInp) + return +} + +// Status 更新充值订单状态 +func (c *cOrder) Status(ctx context.Context, req *order.StatusReq) (res *order.StatusRes, err error) { + err = service.AdminOrder().Status(ctx, &req.OrderStatusInp) + return +} diff --git a/server/internal/controller/admin/admin/post.go b/server/internal/controller/admin/admin/post.go new file mode 100644 index 0000000..2c2faf8 --- /dev/null +++ b/server/internal/controller/admin/admin/post.go @@ -0,0 +1,67 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "hotgo/api/admin/post" + "hotgo/internal/service" +) + +// Post 岗位 +var Post = cPost{} + +type cPost struct{} + +// Delete 删除 +func (c *cPost) Delete(ctx context.Context, req *post.DeleteReq) (res *post.DeleteRes, err error) { + err = service.AdminPost().Delete(ctx, &req.PostDeleteInp) + return +} + +// Edit 修改/新增 +func (c *cPost) Edit(ctx context.Context, req *post.EditReq) (res *post.EditRes, err error) { + err = service.AdminPost().Edit(ctx, &req.PostEditInp) + return +} + +// MaxSort 最大排序 +func (c *cPost) MaxSort(ctx context.Context, req *post.MaxSortReq) (res *post.MaxSortRes, err error) { + res = new(post.MaxSortRes) + res.PostMaxSortModel, err = service.AdminPost().MaxSort(ctx, &req.PostMaxSortInp) + return +} + +// View 获取指定信息 +func (c *cPost) View(ctx context.Context, req *post.ViewReq) (res *post.ViewRes, err error) { + data, err := service.AdminPost().View(ctx, &req.PostViewInp) + if err != nil { + return + } + + res = new(post.ViewRes) + res.PostViewModel = data + return +} + +// List 获取列表 +func (c *cPost) List(ctx context.Context, req *post.ListReq) (res *post.ListRes, err error) { + list, totalCount, err := service.AdminPost().List(ctx, &req.PostListInp) + if err != nil { + return + } + + res = new(post.ListRes) + res.List = list + res.PageRes.Pack(req, totalCount) + return +} + +// Status 更新状态 +func (c *cPost) Status(ctx context.Context, req *post.StatusReq) (res *post.StatusRes, err error) { + err = service.AdminPost().Status(ctx, &req.PostStatusInp) + return +} diff --git a/server/internal/controller/admin/admin/role.go b/server/internal/controller/admin/admin/role.go new file mode 100644 index 0000000..92e626c --- /dev/null +++ b/server/internal/controller/admin/admin/role.go @@ -0,0 +1,81 @@ +// Package admin +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package admin + +import ( + "context" + "hotgo/api/admin/role" + "hotgo/internal/consts" + "hotgo/internal/library/contexts" + "hotgo/internal/service" +) + +var ( + Role = cRole{} +) + +type cRole struct{} + +// List 获取列表 +func (c *cRole) List(ctx context.Context, req *role.ListReq) (res *role.ListRes, err error) { + list, totalCount, err := service.AdminRole().List(ctx, &req.RoleListInp) + if err != nil { + return + } + + res = new(role.ListRes) + res.RoleListModel = list + res.PageRes.Pack(req, totalCount) + return +} + +// Edit 修改角色 +func (c *cRole) Edit(ctx context.Context, req *role.EditReq) (res *role.EditRes, err error) { + err = service.AdminRole().Edit(ctx, &req.RoleEditInp) + return +} + +// Delete 删除 +func (c *cRole) Delete(ctx context.Context, req *role.DeleteReq) (res *role.DeleteRes, err error) { + err = service.AdminRole().Delete(ctx, &req.RoleDeleteInp) + return +} + +// Dynamic 动态路由 +func (c *cRole) Dynamic(ctx context.Context, _ *role.DynamicReq) (res *role.DynamicRes, err error) { + return service.AdminMenu().GetMenuList(ctx, contexts.GetUserId(ctx)) +} + +// GetPermissions 获取指定角色权限 +func (c *cRole) GetPermissions(ctx context.Context, req *role.GetPermissionsReq) (res *role.GetPermissionsRes, err error) { + data, err := service.AdminRole().GetPermissions(ctx, &req.GetPermissionsInp) + if err != nil { + return + } + + res = new(role.GetPermissionsRes) + res.GetPermissionsModel = data + return +} + +// UpdatePermissions 修改角色菜单权限 +func (c *cRole) UpdatePermissions(ctx context.Context, req *role.UpdatePermissionsReq) (res *role.UpdatePermissionsRes, err error) { + err = service.AdminRole().UpdatePermissions(ctx, &req.UpdatePermissionsInp) + return +} + +// DataScopeSelect 获取数据权限选项 +func (c *cRole) DataScopeSelect(_ context.Context, _ *role.DataScopeSelectReq) (res *role.DataScopeSelectRes, err error) { + res = new(role.DataScopeSelectRes) + res.List = consts.DataScopeSelect + return +} + +// DataScopeEdit 获取数据权限选项 +func (c *cRole) DataScopeEdit(ctx context.Context, req *role.DataScopeEditReq) (res *role.DataScopeEditRes, err error) { + err = service.AdminRole().DataScopeEdit(ctx, &req.DataScopeEditInp) + return +} diff --git a/server/internal/controller/admin/common/console.go b/server/internal/controller/admin/common/console.go new file mode 100644 index 0000000..be4f73b --- /dev/null +++ b/server/internal/controller/admin/common/console.go @@ -0,0 +1,51 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "context" + "hotgo/api/admin/common" + "hotgo/internal/service" +) + +var Console = cConsole{} + +type cConsole struct{} + +// Stat 综合数据统计 +func (c *cConsole) Stat(_ context.Context, _ *common.ConsoleStatReq) (res *common.ConsoleStatRes, err error) { + res = new(common.ConsoleStatRes) + + // 此处均为模拟数据,可以根据实际业务情况替换成真实数据 + + res.Visits.DayVisits = 12010 + res.Visits.Rise = 13501 + res.Visits.Decline = 10502 + res.Visits.Amount = 10403 + + res.Saleroom.WeekSaleroom = 20501 + res.Saleroom.Amount = 21002 + res.Saleroom.Degree = 83.66 + + res.OrderLarge.WeekLarge = 39901 + res.OrderLarge.Rise = 31012 + res.OrderLarge.Decline = 30603 + res.OrderLarge.Amount = 36084 + + res.Volume.WeekLarge = 40021 + res.Volume.Rise = 40202 + res.Volume.Decline = 45003 + res.Volume.Amount = 49004 + return +} + +func (c *cConsole) Summary(ctx context.Context, req *common.DashboardSummaryReq) (res *common.DashboardSummaryRes, err error) { + data, err := service.SysDashboard().Summary(ctx, &req.DashboardSummaryInp) + if err != nil { + return nil, err + } + return &common.DashboardSummaryRes{DashboardSummaryModel: data}, nil +} diff --git a/server/internal/controller/admin/common/ems.go b/server/internal/controller/admin/common/ems.go new file mode 100644 index 0000000..5c70c4e --- /dev/null +++ b/server/internal/controller/admin/common/ems.go @@ -0,0 +1,75 @@ +// Package common +// @Link https://github.com/bufanyun/hotgo +// @Copyright Copyright (c) 2023 HotGo CLI +// @Author Ms <133814250@qq.com> +// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE +package common + +import ( + "context" + "github.com/gogf/gf/v2/errors/gerror" + "hotgo/api/admin/common" + "hotgo/internal/consts" + "hotgo/internal/dao" + "hotgo/internal/library/contexts" + "hotgo/internal/model/entity" + "hotgo/internal/model/input/sysin" + "hotgo/internal/service" +) + +var Ems = new(cEms) + +type cEms struct{} + +// SendTest 发送测试邮件 +func (c *cEms) SendTest(ctx context.Context, req *common.SendTestEmailReq) (res *common.SendTestEmailRes, err error) { + err = service.SysEmsLog().Send(ctx, &sysin.SendEmsInp{ + Event: consts.EmsTemplateText, + Email: req.To, + Content: ` + + +
+ +
+ +