feat: add Go backend
This commit is contained in:
@@ -0,0 +1 @@
|
||||
* linguist-language=GO
|
||||
@@ -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
|
||||
@@ -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:]'
|
||||
+113
@@ -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)\"}}}}}";
|
||||
@@ -0,0 +1 @@
|
||||
## HotGo 管理后台服务端
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
```
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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:"数据列表"`
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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:"<html/>"`
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
|
||||
// 定时任务.
|
||||
// 插件中的定时任务可以统一在这里注册和处理
|
||||
@@ -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 // 插件架子
|
||||
)
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package logic
|
||||
|
||||
import (
|
||||
_ "hotgo/addons/hgexample/logic/sys"
|
||||
)
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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:"当前时间"`
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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:"创建时间"`
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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
|
||||
|
||||
// 消息队列.
|
||||
// 插件中的消息队列消费者可以统一在这里注册和处理
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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(
|
||||
// 需要验证的路由
|
||||
// ...
|
||||
)
|
||||
})
|
||||
}
|
||||
@@ -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...)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -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) // 多租户功能演示
|
||||
}
|
||||
@@ -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,
|
||||
)
|
||||
})
|
||||
}
|
||||
@@ -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, // 测试消息
|
||||
})
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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 }
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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{}
|
||||
@@ -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
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
@@ -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{}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user