mirror of
https://gitee.com/johng/gf
synced 2026-06-08 10:37:44 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67ff2c5425 | |||
| 937a8278a8 | |||
| 9c174c1bc5 |
4
.github/workflows/ci-main.yml
vendored
4
.github/workflows/ci-main.yml
vendored
@ -8,7 +8,6 @@ on:
|
||||
- master
|
||||
- develop
|
||||
- personal/**
|
||||
- feat/**
|
||||
- feature/**
|
||||
- enhance/**
|
||||
- fix/**
|
||||
@ -18,7 +17,6 @@ on:
|
||||
- master
|
||||
- develop
|
||||
- personal/**
|
||||
- feat/**
|
||||
- feature/**
|
||||
- enhance/**
|
||||
- fix/**
|
||||
@ -45,7 +43,7 @@ jobs:
|
||||
go-version: [ "1.22", "1.23" ]
|
||||
goarch: [ "386", "amd64" ]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
# Service containers to run with `code-test`
|
||||
services:
|
||||
|
||||
2
.github/workflows/format-code-on-push.yml
vendored
2
.github/workflows/format-code-on-push.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
||||
-s blank \
|
||||
-s default \
|
||||
-s dot \
|
||||
-s "prefix(github.com/gogf/gf/v3)" \
|
||||
-s "prefix(github.com/gogf/gf/v2)" \
|
||||
-s "prefix(github.com/gogf/gf/cmd)" \
|
||||
-s "prefix(github.com/gogf/gf/contrib)" \
|
||||
-s "prefix(github.com/gogf/gf/example)" \
|
||||
|
||||
2
.github/workflows/issue-check-inactive.yml
vendored
2
.github/workflows/issue-check-inactive.yml
vendored
@ -23,6 +23,6 @@ jobs:
|
||||
with:
|
||||
actions: 'check-inactive'
|
||||
inactive-label: 'inactive'
|
||||
inactive-day: 30
|
||||
inactive-day: 7
|
||||
issue-state: open
|
||||
exclude-labels: 'bug,planned,$exclude-empty'
|
||||
2
.github/workflows/scripts/before_script.sh
vendored
2
.github/workflows/scripts/before_script.sh
vendored
@ -21,7 +21,7 @@ gci write \
|
||||
-s blank \
|
||||
-s default \
|
||||
-s dot \
|
||||
-s "prefix(github.com/gogf/gf/v3)" \
|
||||
-s "prefix(github.com/gogf/gf/v2)" \
|
||||
-s "prefix(github.com/gogf/gf/cmd)" \
|
||||
-s "prefix(github.com/gogf/gf/contrib)" \
|
||||
-s "prefix(github.com/gogf/gf/example)" \
|
||||
|
||||
4
.github/workflows/scripts/ci-main.sh
vendored
4
.github/workflows/scripts/ci-main.sh
vendored
@ -55,8 +55,8 @@ for file in `find . -name go.mod`; do
|
||||
if [ "${coverage}" = "coverage" ]; then
|
||||
go test ./... -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./...,github.com/gogf/gf/... || exit 1
|
||||
|
||||
if grep -q "/gogf/gf/.*/v3" go.mod; then
|
||||
sed -i "s/gogf\/gf\(\/.*\)\/v3/gogf\/gf\/v3\1/g" coverage.out
|
||||
if grep -q "/gogf/gf/.*/v2" go.mod; then
|
||||
sed -i "s/gogf\/gf\(\/.*\)\/v2/gogf\/gf\/v2\1/g" coverage.out
|
||||
fi
|
||||
else
|
||||
go test ./... -race || exit 1
|
||||
|
||||
@ -57,11 +57,11 @@ for file in `find ${workdir} -name go.mod`; do
|
||||
[ -z "$dep" ] && continue
|
||||
|
||||
# Calculate the relative path for the replacement
|
||||
if [[ "$dep" == "github.com/gogf/gf/v3" ]]; then
|
||||
if [[ "$dep" == "github.com/gogf/gf/v2" ]]; then
|
||||
replacement="$relativePath"
|
||||
else
|
||||
# Extract the path after v2 and remove trailing version
|
||||
subpath=$(echo "$dep" | sed -E 's/github\.com\/gogf\/gf\/(contrib\/[^/]+\/[^/]+)\/v3.*/\1/')
|
||||
subpath=$(echo "$dep" | sed -E 's/github\.com\/gogf\/gf\/(contrib\/[^/]+\/[^/]+)\/v2.*/\1/')
|
||||
replacement="$relativePath/$subpath"
|
||||
fi
|
||||
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -18,10 +18,8 @@ go.work
|
||||
go.work.sum
|
||||
!cmd/gf/go.work
|
||||
.windsurfrules
|
||||
.make_v3.sh
|
||||
|
||||
# Ignore for docs
|
||||
node_modules
|
||||
.docusaurus
|
||||
output
|
||||
.example/
|
||||
@ -116,7 +116,7 @@ linters-settings:
|
||||
# A comma-separated list of prefixes, which, if set, checks import paths
|
||||
# with the given prefixes are grouped after 3rd-party packages.
|
||||
# Default: ""
|
||||
local-prefixes: github.com/gogf/gf/v3
|
||||
local-prefixes: github.com/gogf/gf/v2
|
||||
gci:
|
||||
# Section configuration to compare against.
|
||||
# Section names are case-insensitive and may contain parameters in ().
|
||||
|
||||
@ -57,13 +57,13 @@ for file in `find ${workdir} -name go.mod`; do
|
||||
cd $goModPath
|
||||
if [ $goModPath = "./cmd/gf" ]; then
|
||||
mv go.work go.work.version.bak
|
||||
go mod edit -replace github.com/gogf/gf/v3=../../
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/clickhouse/v3=../../contrib/drivers/clickhouse
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/mssql/v3=../../contrib/drivers/mssql
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/mysql/v3=../../contrib/drivers/mysql
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/oracle/v3=../../contrib/drivers/oracle
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/pgsql/v3=../../contrib/drivers/pgsql
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/sqlite/v3=../../contrib/drivers/sqlite
|
||||
go mod edit -replace github.com/gogf/gf/v2=../../
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/clickhouse/v2=../../contrib/drivers/clickhouse
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/mssql/v2=../../contrib/drivers/mssql
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/mysql/v2=../../contrib/drivers/mysql
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/oracle/v2=../../contrib/drivers/oracle
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/pgsql/v2=../../contrib/drivers/pgsql
|
||||
go mod edit -replace github.com/gogf/gf/contrib/drivers/sqlite/v2=../../contrib/drivers/sqlite
|
||||
fi
|
||||
go mod tidy
|
||||
# Remove toolchain line if exists
|
||||
@ -77,13 +77,13 @@ for file in `find ${workdir} -name go.mod`; do
|
||||
# Remove toolchain line if exists
|
||||
sed -i '' '/^toolchain/d' go.mod
|
||||
if [ $goModPath = "./cmd/gf" ]; then
|
||||
go mod edit -dropreplace github.com/gogf/gf/v3
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/clickhouse/v3
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/mssql/v3
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/mysql/v3
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/oracle/v3
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/pgsql/v3
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/sqlite/v3
|
||||
go mod edit -dropreplace github.com/gogf/gf/v2
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/clickhouse/v2
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/mssql/v2
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/mysql/v2
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/oracle/v2
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/pgsql/v2
|
||||
go mod edit -dropreplace github.com/gogf/gf/contrib/drivers/sqlite/v2
|
||||
mv go.work.version.bak go.work
|
||||
fi
|
||||
cd -
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
<div align=center>
|
||||
<img src="https://goframe.org/img/logo_full.png" width="300" alt="goframe gf logo"/>
|
||||
|
||||
[](https://pkg.go.dev/github.com/gogf/gf/v3)
|
||||
[](https://pkg.go.dev/github.com/gogf/gf/v2)
|
||||
[](https://github.com/gogf/gf/actions/workflows/ci-main.yml)
|
||||
[](https://goreportcard.com/report/github.com/gogf/gf/v3)
|
||||
[](https://goreportcard.com/report/github.com/gogf/gf/v2)
|
||||
[](https://codecov.io/gh/gogf/gf)
|
||||
[](https://github.com/gogf/gf)
|
||||
[](https://github.com/gogf/gf)
|
||||
@ -28,7 +28,7 @@ A powerful framework for faster, easier, and more efficient project development.
|
||||
- GoFrame Official Site(en): [https://goframe.org/en](https://goframe.org/en)
|
||||
- GoFrame Mirror Site(中文): [https://goframe.org.cn](https://goframe.org.cn)
|
||||
- GoFrame Mirror Site(github pages): [https://pages.goframe.org](https://pages.goframe.org)
|
||||
- GoDoc API: [https://pkg.go.dev/github.com/gogf/gf/v3](https://pkg.go.dev/github.com/gogf/gf/v3)
|
||||
- GoDoc API: [https://pkg.go.dev/github.com/gogf/gf/v2](https://pkg.go.dev/github.com/gogf/gf/v2)
|
||||
|
||||
|
||||
# Contributors
|
||||
@ -36,7 +36,7 @@ A powerful framework for faster, easier, and more efficient project development.
|
||||
💖 [Thanks to all the contributors who made GoFrame possible](https://github.com/gogf/gf/graphs/contributors) 💖
|
||||
|
||||
<a href="https://github.com/gogf/gf/graphs/contributors">
|
||||
<img src="https://goframe.org/img/contributors.svg?version=v2.9.0" alt="goframe contributors"/>
|
||||
<img src="https://goframe.org/img/contributors.svg?version=v2.9.0-beta" alt="goframe contributors"/>
|
||||
</a>
|
||||
|
||||
# License
|
||||
|
||||
@ -37,8 +37,8 @@ You can also install `gf` tool using pre-built binaries: <https://github.com/gog
|
||||
## 2) Manually Install
|
||||
|
||||
```shell
|
||||
go install github.com/gogf/gf/cmd/gf/v3@latest # latest version
|
||||
go install github.com/gogf/gf/cmd/gf/v3@v2.5.5 # certain version(should be >= v2.5.5)
|
||||
go install github.com/gogf/gf/cmd/gf/v2@latest # latest version
|
||||
go install github.com/gogf/gf/cmd/gf/v2@v2.5.5 # certain version(should be >= v2.5.5)
|
||||
```
|
||||
|
||||
## 2. Commands
|
||||
|
||||
@ -11,19 +11,19 @@ import (
|
||||
"context"
|
||||
"runtime"
|
||||
|
||||
_ "github.com/gogf/gf/cmd/gf/v3/internal/packed"
|
||||
_ "github.com/gogf/gf/cmd/gf/v2/internal/packed"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gcfg"
|
||||
"github.com/gogf/gf/v3/os/gcmd"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcfg"
|
||||
"github.com/gogf/gf/v2/os/gcmd"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/allyes"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/allyes"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
const cliFolderName = `hack`
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
module github.com/gogf/gf/cmd/gf/v3
|
||||
module github.com/gogf/gf/cmd/gf/v2
|
||||
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
github.com/gogf/gf/contrib/drivers/clickhouse/v3 v3.0.0-alpha
|
||||
github.com/gogf/gf/contrib/drivers/mssql/v3 v3.0.0-alpha
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v3 v3.0.0-alpha
|
||||
github.com/gogf/gf/contrib/drivers/oracle/v3 v3.0.0-alpha
|
||||
github.com/gogf/gf/contrib/drivers/pgsql/v3 v3.0.0-alpha
|
||||
github.com/gogf/gf/contrib/drivers/sqlite/v3 v3.0.0-alpha
|
||||
github.com/gogf/gf/v3 v3.0.0-alpha
|
||||
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.9.0-beta
|
||||
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.9.0-beta
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0-beta
|
||||
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.9.0-beta
|
||||
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.9.0-beta
|
||||
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.9.0-beta
|
||||
github.com/gogf/gf/v2 v2.9.0-beta
|
||||
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/schollz/progressbar/v3 v3.15.0
|
||||
|
||||
@ -10,11 +10,11 @@ use (
|
||||
// =====================================================================================================
|
||||
|
||||
replace (
|
||||
github.com/gogf/gf/contrib/drivers/clickhouse/v3 => ../../contrib/drivers/clickhouse
|
||||
github.com/gogf/gf/contrib/drivers/mssql/v3 => ../../contrib/drivers/mssql
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v3 => ../../contrib/drivers/mysql
|
||||
github.com/gogf/gf/contrib/drivers/oracle/v3 => ../../contrib/drivers/oracle
|
||||
github.com/gogf/gf/contrib/drivers/pgsql/v3 => ../../contrib/drivers/pgsql
|
||||
github.com/gogf/gf/contrib/drivers/sqlite/v3 => ../../contrib/drivers/sqlite
|
||||
github.com/gogf/gf/v3 => ../../
|
||||
github.com/gogf/gf/contrib/drivers/clickhouse/v2 => ../../contrib/drivers/clickhouse
|
||||
github.com/gogf/gf/contrib/drivers/mssql/v2 => ../../contrib/drivers/mssql
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 => ../../contrib/drivers/mysql
|
||||
github.com/gogf/gf/contrib/drivers/oracle/v2 => ../../contrib/drivers/oracle
|
||||
github.com/gogf/gf/contrib/drivers/pgsql/v2 => ../../contrib/drivers/pgsql
|
||||
github.com/gogf/gf/contrib/drivers/sqlite/v2 => ../../contrib/drivers/sqlite
|
||||
github.com/gogf/gf/v2 => ../../
|
||||
)
|
||||
|
||||
@ -11,13 +11,13 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gcmd"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcmd"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/service"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/service"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
// GF is the management object for `gf` command line tool.
|
||||
|
||||
@ -15,19 +15,19 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/encoding/gbase64"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gbuild"
|
||||
"github.com/gogf/gf/v3/os/gcmd"
|
||||
"github.com/gogf/gf/v3/os/genv"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/encoding/gbase64"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gbuild"
|
||||
"github.com/gogf/gf/v2/os/gcmd"
|
||||
"github.com/gogf/gf/v2/os/genv"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -225,7 +225,7 @@ func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, e
|
||||
|
||||
// Injected information by building flags.
|
||||
ldFlags := fmt.Sprintf(
|
||||
`-X 'github.com/gogf/gf/v3/os/gbuild.builtInVarStr=%v'`,
|
||||
`-X 'github.com/gogf/gf/v2/os/gbuild.builtInVarStr=%v'`,
|
||||
c.getBuildInVarStr(ctx, in),
|
||||
)
|
||||
|
||||
|
||||
@ -16,11 +16,11 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v3/encoding/gcompress"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v2/encoding/gcompress"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -11,13 +11,13 @@ import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -12,12 +12,12 @@ import (
|
||||
|
||||
"github.com/olekukonko/tablewriter"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -9,14 +9,14 @@ package cmd
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -93,7 +93,7 @@ func (c cFix) doFixV23(version string) error {
|
||||
// gdb.TX from struct to interface.
|
||||
content = gstr.Replace(content, "*gdb.TX", "gdb.TX")
|
||||
// function name changes for package gtcp/gudp.
|
||||
if gstr.Contains(content, "/gf/v3/net/gtcp") || gstr.Contains(content, "/gf/v3/net/gudp") {
|
||||
if gstr.Contains(content, "/gf/v2/net/gtcp") || gstr.Contains(content, "/gf/v2/net/gudp") {
|
||||
content = gstr.ReplaceByMap(content, g.MapStrStr{
|
||||
".SetSendDeadline": ".SetDeadlineSend",
|
||||
".SetReceiveDeadline": ".SetDeadlineRecv",
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/genctrl"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genctrl"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@ -7,17 +7,17 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/contrib/drivers/clickhouse/v3"
|
||||
_ "github.com/gogf/gf/contrib/drivers/mssql/v3"
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v3"
|
||||
_ "github.com/gogf/gf/contrib/drivers/oracle/v3"
|
||||
_ "github.com/gogf/gf/contrib/drivers/pgsql/v3"
|
||||
_ "github.com/gogf/gf/contrib/drivers/sqlite/v3"
|
||||
_ "github.com/gogf/gf/contrib/drivers/clickhouse/v2"
|
||||
_ "github.com/gogf/gf/contrib/drivers/mssql/v2"
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
_ "github.com/gogf/gf/contrib/drivers/oracle/v2"
|
||||
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
|
||||
_ "github.com/gogf/gf/contrib/drivers/sqlite/v2"
|
||||
|
||||
// do not add dm in cli pre-compilation,
|
||||
// the dm driver does not support certain target platforms.
|
||||
// _ "github.com/gogf/gf/contrib/drivers/dm/v3"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/gendao"
|
||||
// _ "github.com/gogf/gf/contrib/drivers/dm/v2"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/gendao"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/genenums"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genenums"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package cmd
|
||||
|
||||
import "github.com/gogf/gf/cmd/gf/v3/internal/cmd/genpb"
|
||||
import "github.com/gogf/gf/cmd/gf/v2/internal/cmd/genpb"
|
||||
|
||||
type (
|
||||
cGenPb = genpb.CGenPb
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package cmd
|
||||
|
||||
import "github.com/gogf/gf/cmd/gf/v3/internal/cmd/genpbentity"
|
||||
import "github.com/gogf/gf/cmd/gf/v2/internal/cmd/genpbentity"
|
||||
|
||||
type (
|
||||
cGenPbEntity = genpbentity.CGenPbEntity
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/genservice"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genservice"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@ -12,17 +12,17 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gcmd"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/os/gres"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcmd"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/os/gres"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/allyes"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/allyes"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -152,8 +152,8 @@ func (c cInit) Index(ctx context.Context, in cInitInput) (out *cInitOutput, err
|
||||
// Update the GoFrame version.
|
||||
if in.Update {
|
||||
mlog.Print("update goframe...")
|
||||
// go get -u github.com/gogf/gf/v3@latest
|
||||
updateCommand := `go get -u github.com/gogf/gf/v3@latest`
|
||||
// go get -u github.com/gogf/gf/v2@latest
|
||||
updateCommand := `go get -u github.com/gogf/gf/v2@latest`
|
||||
if in.Name != "." {
|
||||
updateCommand = fmt.Sprintf(`cd %s && %s`, in.Name, updateCommand)
|
||||
}
|
||||
|
||||
@ -9,9 +9,9 @@ package cmd
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/service"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -10,14 +10,14 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gcmd"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gres"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcmd"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gres"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/allyes"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/allyes"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -14,16 +14,16 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gatomic"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gfsnotify"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/os/gtimer"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/container/gtype"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gfsnotify"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/os/gtimer"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -116,7 +116,7 @@ func (c cRun) Index(ctx context.Context, in cRunInput) (out *cRunOutput, err err
|
||||
Args: in.Args,
|
||||
WatchPaths: in.WatchPaths,
|
||||
}
|
||||
dirty := gatomic.NewBool()
|
||||
dirty := gtype.NewBool()
|
||||
|
||||
var outputPath = app.genOutputPath()
|
||||
callbackFunc := func(event *gfsnotify.Event) {
|
||||
|
||||
@ -9,15 +9,15 @@ package cmd
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
"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/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -13,15 +13,15 @@ import (
|
||||
|
||||
"github.com/gogf/selfupdate"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -14,16 +14,16 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v3"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gbuild"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gbuild"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -22,7 +22,7 @@ var (
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
testDB, err = gdb.New(&gdb.ConfigNode{
|
||||
testDB, err = gdb.New(gdb.ConfigNode{
|
||||
Link: link,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@ -9,10 +9,10 @@ package cmd
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
)
|
||||
|
||||
func Test_Build_Single(t *testing.T) {
|
||||
|
||||
@ -9,7 +9,7 @@ package cmd
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
)
|
||||
|
||||
func Test_Fix_doFixV25Content(t *testing.T) {
|
||||
|
||||
@ -10,12 +10,12 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/genctrl"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genctrl"
|
||||
)
|
||||
|
||||
func Test_Gen_Ctrl_Default(t *testing.T) {
|
||||
@ -108,7 +108,7 @@ func Test_Gen_Ctrl_UseMerge_AddNewFile(t *testing.T) {
|
||||
)
|
||||
const testNewApiFile = `
|
||||
package v1
|
||||
import "github.com/gogf/gf/v3/frame/g"
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
type DictTypeAddReq struct {
|
||||
g.Meta
|
||||
}
|
||||
|
||||
@ -11,16 +11,16 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gcfg"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcfg"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/gendao"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/gendao"
|
||||
)
|
||||
|
||||
// https://github.com/gogf/gf/issues/2572
|
||||
@ -225,7 +225,7 @@ func Test_Gen_Dao_Issue2746(t *testing.T) {
|
||||
table,
|
||||
)
|
||||
)
|
||||
mdb, err = gdb.New(&gdb.ConfigNode{
|
||||
mdb, err = gdb.New(gdb.ConfigNode{
|
||||
Link: link2746,
|
||||
})
|
||||
t.AssertNil(err)
|
||||
|
||||
@ -9,13 +9,13 @@ package cmd
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/gendao"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/gendao"
|
||||
)
|
||||
|
||||
func Test_Gen_Dao_Sharding(t *testing.T) {
|
||||
|
||||
@ -11,14 +11,14 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/gendao"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/gendao"
|
||||
)
|
||||
|
||||
func Test_Gen_Dao_Default(t *testing.T) {
|
||||
@ -348,7 +348,7 @@ func Test_Gen_Dao_Sqlite3(t *testing.T) {
|
||||
t.AssertNil(err)
|
||||
defer gfile.Remove(path)
|
||||
|
||||
dbSqlite3, err := gdb.New(&gdb.ConfigNode{
|
||||
dbSqlite3, err := gdb.New(gdb.ConfigNode{
|
||||
Link: linkSqlite3,
|
||||
})
|
||||
t.AssertNil(err)
|
||||
|
||||
@ -10,12 +10,12 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/genpb"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genpb"
|
||||
)
|
||||
|
||||
func TestGenPbIssue3882(t *testing.T) {
|
||||
|
||||
@ -11,13 +11,13 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/genpbentity"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genpbentity"
|
||||
)
|
||||
|
||||
func Test_Gen_Pbentity_Default(t *testing.T) {
|
||||
|
||||
@ -10,12 +10,12 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/genservice"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/genservice"
|
||||
)
|
||||
|
||||
func Test_Gen_Service_Default(t *testing.T) {
|
||||
|
||||
@ -9,13 +9,13 @@ package genctrl
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -9,7 +9,7 @@ package genctrl
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
)
|
||||
|
||||
type apiItem struct {
|
||||
|
||||
@ -13,8 +13,8 @@ import (
|
||||
"go/printer"
|
||||
"go/token"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
)
|
||||
|
||||
type structInfo struct {
|
||||
|
||||
@ -13,7 +13,7 @@ import (
|
||||
"go/printer"
|
||||
"go/token"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
)
|
||||
|
||||
// getFuncInDst retrieves all function declarations and bodies in the file.
|
||||
|
||||
@ -7,11 +7,11 @@
|
||||
package genctrl
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
func (c CGenCtrl) getApiItemsInSrc(apiModuleFolderPath string) (items []apiItem, err error) {
|
||||
|
||||
@ -11,13 +11,13 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
type controllerGenerator struct{}
|
||||
|
||||
@ -9,10 +9,10 @@ package genctrl
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
type controllerClearer struct{}
|
||||
|
||||
@ -10,16 +10,16 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gmap"
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
type apiInterfaceGenerator struct{}
|
||||
|
||||
@ -10,14 +10,14 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
type apiSdkGenerator struct{}
|
||||
|
||||
@ -13,19 +13,19 @@ import (
|
||||
|
||||
"golang.org/x/mod/modfile"
|
||||
|
||||
"github.com/gogf/gf/v3/container/garray"
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/os/gview"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/os/gview"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
type (
|
||||
@ -258,19 +258,19 @@ func doGenDaoForArray(ctx context.Context, index int, in CGenDaoInput) {
|
||||
func getImportPartContent(ctx context.Context, source string, isDo bool, appendImports []string) string {
|
||||
var packageImportsArray = garray.NewStrArray()
|
||||
if isDo {
|
||||
packageImportsArray.Append(`"github.com/gogf/gf/v3/frame/g"`)
|
||||
packageImportsArray.Append(`"github.com/gogf/gf/v2/frame/g"`)
|
||||
}
|
||||
|
||||
// Time package recognition.
|
||||
if strings.Contains(source, "gtime.Time") {
|
||||
packageImportsArray.Append(`"github.com/gogf/gf/v3/os/gtime"`)
|
||||
packageImportsArray.Append(`"github.com/gogf/gf/v2/os/gtime"`)
|
||||
} else if strings.Contains(source, "time.Time") {
|
||||
packageImportsArray.Append(`"time"`)
|
||||
}
|
||||
|
||||
// Json type.
|
||||
if strings.Contains(source, "gjson.Json") {
|
||||
packageImportsArray.Append(`"github.com/gogf/gf/v3/encoding/gjson"`)
|
||||
packageImportsArray.Append(`"github.com/gogf/gf/v2/encoding/gjson"`)
|
||||
}
|
||||
|
||||
// Check and update imports in go.mod
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
package gendao
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
func doClear(items *CGenDaoInternalGenItems) {
|
||||
|
||||
@ -15,15 +15,15 @@ import (
|
||||
|
||||
"github.com/olekukonko/tablewriter"
|
||||
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gview"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gview"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
func generateDao(ctx context.Context, in CGenDaoInternalInput) {
|
||||
|
||||
@ -12,14 +12,14 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gview"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gview"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
func generateDo(ctx context.Context, in CGenDaoInternalInput) {
|
||||
|
||||
@ -11,13 +11,13 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gview"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gview"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
func generateEntity(ctx context.Context, in CGenDaoInternalInput) {
|
||||
|
||||
@ -14,10 +14,10 @@ import (
|
||||
|
||||
"github.com/olekukonko/tablewriter"
|
||||
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
)
|
||||
|
||||
type generateStructDefinitionInput struct {
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
package gendao
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -11,13 +11,13 @@ import (
|
||||
|
||||
"golang.org/x/tools/go/packages"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@ -12,9 +12,9 @@ import (
|
||||
|
||||
"golang.org/x/tools/go/packages"
|
||||
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
const pkgLoadMode = 0xffffff
|
||||
|
||||
@ -9,12 +9,12 @@ package genpb
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gproc"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@ -11,12 +11,12 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
type generateControllerInput struct {
|
||||
|
||||
@ -10,14 +10,14 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gmap"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
type generateStructTagInput struct {
|
||||
|
||||
@ -16,21 +16,21 @@ import (
|
||||
|
||||
"github.com/olekukonko/tablewriter"
|
||||
|
||||
"github.com/gogf/gf/v3/container/garray"
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gctx"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@ -13,18 +13,18 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/v3/container/garray"
|
||||
"github.com/gogf/gf/v3/container/gmap"
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -12,15 +12,15 @@ import (
|
||||
"go/token"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/os/gstructs"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/os/gstructs"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
)
|
||||
|
||||
type pkgItem struct {
|
||||
Alias string `eg:"gdbas"`
|
||||
Path string `eg:"github.com/gogf/gf/v3/database/gdb"`
|
||||
RawImport string `eg:"gdbas github.com/gogf/gf/v3/database/gdb"`
|
||||
Path string `eg:"github.com/gogf/gf/v2/database/gdb"`
|
||||
RawImport string `eg:"gdbas github.com/gogf/gf/v2/database/gdb"`
|
||||
}
|
||||
|
||||
type funcItem struct {
|
||||
@ -199,7 +199,7 @@ func (c CGenService) parseImportPackages(node *ast.ImportSpec) (packages pkgItem
|
||||
|
||||
// getRealAlias retrieves the real alias of the package.
|
||||
// If package is "github.com/gogf/gf", the alias is "gf".
|
||||
// If package is "github.com/gogf/gf/v3", the alias is "gf" instead of "v2".
|
||||
// If package is "github.com/gogf/gf/v2", the alias is "gf" instead of "v2".
|
||||
func (c CGenService) getRealAlias(importPath string) (pkgName string) {
|
||||
importPath = gstr.Trim(importPath, `"`)
|
||||
parts := gstr.Split(importPath, "/")
|
||||
|
||||
@ -10,13 +10,13 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v3/container/garray"
|
||||
"github.com/gogf/gf/v3/container/gmap"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
)
|
||||
|
||||
func (c CGenService) calculateImportedItems(
|
||||
@ -66,11 +66,11 @@ func (c CGenService) calculateFuncItems(
|
||||
|
||||
for _, item := range funcItems {
|
||||
var (
|
||||
// Example: "sArticle"
|
||||
// eg: "sArticle"
|
||||
receiverName string
|
||||
receiverMatch []string
|
||||
|
||||
// Example: "GetList(ctx context.Context, req *v1.ArticleListReq) (list []*v1.Article, err error)"
|
||||
// eg: "GetList(ctx context.Context, req *v1.ArticleListReq) (list []*v1.Article, err error)"
|
||||
funcHead string
|
||||
)
|
||||
|
||||
|
||||
@ -10,14 +10,14 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gmap"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gfile"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gfile"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/utility/utils"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
|
||||
)
|
||||
|
||||
type generateServiceFilesInput struct {
|
||||
|
||||
@ -10,12 +10,12 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v3/container/gmap"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/consts"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
|
||||
)
|
||||
|
||||
func (c CGenService) generatePackageImports(generatedContent *bytes.Buffer, packageName string, imports []string) {
|
||||
|
||||
10
cmd/gf/internal/cmd/testdata/build/varmap/go.mod
vendored
10
cmd/gf/internal/cmd/testdata/build/varmap/go.mod
vendored
@ -1,12 +1,12 @@
|
||||
module github.com/gogf/gf/cmd/gf/cmd/gf/testdata/vardump/v2
|
||||
|
||||
go 1.22
|
||||
go 1.18
|
||||
|
||||
require github.com/gogf/gf/v3 v2.8.2
|
||||
require github.com/gogf/gf/v2 v2.8.2
|
||||
|
||||
require (
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel v1.24.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.24.0 // indirect
|
||||
)
|
||||
|
||||
replace github.com/gogf/gf/v3 => ../../../../../../../
|
||||
replace github.com/gogf/gf/v2 => ../../../../../../../
|
||||
|
||||
@ -19,12 +19,10 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
|
||||
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
|
||||
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
|
||||
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
|
||||
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
|
||||
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
|
||||
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
|
||||
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
|
||||
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
|
||||
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
||||
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||
|
||||
@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v3/os/gbuild"
|
||||
"github.com/gogf/gf/v2/os/gbuild"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@ -5,10 +5,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/net/ghttp"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
)
|
||||
|
||||
func Test_Router_Hook_Multi(t *testing.T) {
|
||||
|
||||
@ -7,7 +7,7 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
)
|
||||
|
||||
type IDictV1 interface {
|
||||
|
||||
@ -7,7 +7,7 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
)
|
||||
|
||||
type IDictV1 interface {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v3/frame/g"
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type DictTypeAddPageReq struct {
|
||||
g.Meta `path:"/dict/type/add" tags:"字典管理" method:"get" summary:"字典类型添加页面"`
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
package dict
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
@ -3,10 +3,10 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) DictTypeAddPage(ctx context.Context, req *v1.DictTypeAddPageReq) (res *v1.DictTypeAddPageRes, err error) {
|
||||
|
||||
@ -3,10 +3,10 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) DictTypeAddPage(ctx context.Context, req *v1.DictTypeAddPageReq) (res *v1.DictTypeAddPageRes, err error) {
|
||||
|
||||
@ -7,7 +7,7 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_ctrl/api/dict/v1"
|
||||
)
|
||||
|
||||
type IDictV1 interface {
|
||||
|
||||
@ -7,7 +7,7 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict/v1"
|
||||
)
|
||||
|
||||
type IDictV1 interface {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v3/frame/g"
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type DictTypeAddPageReq struct {
|
||||
g.Meta `path:"/dict/type/add" tags:"字典管理" method:"get" summary:"字典类型添加页面"`
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
package dict
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
@ -3,10 +3,10 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) DictTypeAddPage(ctx context.Context, req *v1.DictTypeAddPageReq) (res *v1.DictTypeAddPageRes, err error) {
|
||||
|
||||
@ -3,10 +3,10 @@ package dict
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl-merge/add_new_file/api/dict/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) DictTypeAdd(ctx context.Context, req *v1.DictTypeAddReq) (res *v1.DictTypeAddRes, err error) {
|
||||
|
||||
@ -7,8 +7,8 @@ package article
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v2"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v2"
|
||||
)
|
||||
|
||||
type IArticleV1 interface {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v3/frame/g"
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type (
|
||||
// CreateReq add title.
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v3/frame/g"
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type GetListReq struct {
|
||||
g.Meta `path:"/article/list" method:"get" tags:"ArticleService"`
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
package v2
|
||||
|
||||
import "github.com/gogf/gf/v3/frame/g"
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type CreateReq struct {
|
||||
g.Meta `path:"/article/create" method:"post" tags:"ArticleService"`
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
package article
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
@ -3,10 +3,10 @@ package article
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
)
|
||||
|
||||
// Create add title.
|
||||
|
||||
@ -3,10 +3,10 @@ package article
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) {
|
||||
|
||||
@ -3,10 +3,10 @@ package article
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) GetOne(ctx context.Context, req *v1.GetOneReq) (res *v1.GetOneRes, err error) {
|
||||
|
||||
@ -3,10 +3,10 @@ package article
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) {
|
||||
|
||||
@ -3,10 +3,10 @@ package article
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v2"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v2"
|
||||
)
|
||||
|
||||
func (c *ControllerV2) Create(ctx context.Context, req *v2.CreateReq) (res *v2.CreateRes, err error) {
|
||||
|
||||
@ -3,10 +3,10 @@ package article
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
|
||||
"github.com/gogf/gf/cmd/gf/v3/internal/cmd/testdata/genctrl/api/article/v2"
|
||||
"github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/genctrl/api/article/v2"
|
||||
)
|
||||
|
||||
func (c *ControllerV2) Update(ctx context.Context, req *v2.UpdateReq) (res *v2.UpdateRes, err error) {
|
||||
|
||||
@ -7,8 +7,8 @@ package internal
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v3/database/gdb"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// TableUserDao is the data access object for the table table_user.
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// TableUser is the golang structure of table table_user for DAO operations like Where/Data.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user