Skip to content

Commit 147e7b9

Browse files
authored
internal/parser: mongo: import json (#331)
* cmd: cut v2.8.3 * cmd: cut v2.8.5 * ci: bump upload artifacts to v4 * internal/parser: mongo: import json
1 parent 6ae818d commit 147e7b9

File tree

9 files changed

+28
-12
lines changed

9 files changed

+28
-12
lines changed

.github/workflows/e2e.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
name: "mysql"
1515
strategy:
1616
matrix:
17-
go: ["1.18","1.20","1.21"]
17+
go: ["1.18", "1.24"]
1818
runs-on: ubuntu-latest
1919
container:
20-
image: golang:${{ matrix.go }}
20+
image: golang:${{ matrix.go }}
2121
services:
2222
mysql:
2323
image: mysql:5.7
@@ -50,10 +50,10 @@ jobs:
5050
name: "mysqlr"
5151
strategy:
5252
matrix:
53-
go: ["1.18","1.20","1.21"]
53+
go: ["1.18", "1.24"]
5454
runs-on: ubuntu-latest
5555
container:
56-
image: golang:${{ matrix.go }}
56+
image: golang:${{ matrix.go }}
5757
services:
5858
mysql:
5959
image: mysql:5.7
@@ -86,10 +86,10 @@ jobs:
8686
name: "mongo"
8787
strategy:
8888
matrix:
89-
go: ["1.18","1.20","1.21"]
89+
go: ["1.18", "1.24"]
9090
runs-on: ubuntu-latest
9191
container:
92-
image: golang:${{ matrix.go }}
92+
image: golang:${{ matrix.go }}
9393
services:
9494
mongo:
9595
image: mongo:4.2
@@ -118,10 +118,10 @@ jobs:
118118
name: "customized-plugin"
119119
strategy:
120120
matrix:
121-
go: ["1.18","1.20","1.21"]
121+
go: ["1.18", "1.24"]
122122
runs-on: ubuntu-latest
123123
container:
124-
image: golang:${{ matrix.go }}
124+
image: golang:${{ matrix.go }}
125125
steps:
126126
- name: checkout
127127
uses: actions/checkout@v4

.github/workflows/go-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131
-
3232
name: Upload assets
33-
uses: actions/upload-artifact@v2
33+
uses: actions/upload-artifact@v4
3434
with:
3535
name: ezorm
3636
path: dist/*

.github/workflows/parser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
go: ["1.18","1.20","1.21"]
19+
go: ["1.18", "1.24"]
2020
container:
21-
image: golang:${{ matrix.go }}
21+
image: golang:${{ matrix.go }}
2222
steps:
2323
- name: checkout
2424
uses: actions/checkout@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ db/config.go
44
.vscode/
55
.idea/
66
bin/
7+
mise*

cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func version(commit string) string {
3333
const (
3434
vMajor = 2
3535
vMinor = 8
36-
vPatch = 10
36+
vPatch = 11
3737
)
3838

3939
// versionCmd represents the version command

e2e/mongo/nested/gen_User_mongo_orm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package nested
22

33
import (
44
"context"
5+
"encoding/json"
56
"time"
67

78
"github.com/ezbuy/ezorm/v2/pkg/orm"
@@ -15,6 +16,9 @@ import (
1516
// To import `time` package globally to satisfy `time.Time` index in yaml definition
1617
var _ time.Time
1718

19+
// To import `json` package globally to satisfy `json.Marshaler` interface in yaml definition
20+
var _ json.Marshaler
21+
1822
const ColUser = "mongo_e2e.User"
1923

2024
var UserIndexes = []mongo.IndexModel{

e2e/mongo/user/gen_UserBlog_mongo_orm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package user
22

33
import (
44
"context"
5+
"encoding/json"
56
"time"
67

78
"github.com/ezbuy/ezorm/v2/pkg/orm"
@@ -15,6 +16,9 @@ import (
1516
// To import `time` package globally to satisfy `time.Time` index in yaml definition
1617
var _ time.Time
1718

19+
// To import `json` package globally to satisfy `json.Marshaler` interface in yaml definition
20+
var _ json.Marshaler
21+
1822
const ColUserBlog = "test_user_blog"
1923

2024
var UserBlogIndexes = []mongo.IndexModel{

e2e/mongo/user/gen_User_mongo_orm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package user
22

33
import (
44
"context"
5+
"encoding/json"
56
"time"
67

78
"github.com/ezbuy/ezorm/v2/pkg/orm"
@@ -15,6 +16,9 @@ import (
1516
// To import `time` package globally to satisfy `time.Time` index in yaml definition
1617
var _ time.Time
1718

19+
// To import `json` package globally to satisfy `json.Marshaler` interface in yaml definition
20+
var _ json.Marshaler
21+
1822
const ColUser = "test_user"
1923

2024
var UserIndexes = []mongo.IndexModel{

internal/parser/shared/tpl/mongo_orm.gogo

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import (
66
"context"
77
"time"
8+
"encoding/json"
89

910
"github.com/ezbuy/ezorm/v2/pkg/orm"
1011

@@ -16,6 +17,8 @@ import (
1617

1718
// To import `time` package globally to satisfy `time.Time` index in yaml definition
1819
var _ time.Time
20+
// To import `json` package globally to satisfy `json.Marshaler` interface in yaml definition
21+
var _ json.Marshaler
1922

2023
const Col{{.Name}} = "{{if eq .Table ""}}{{.Namespace}}.{{.Name}}{{else}}{{.Table}}{{end}}"
2124

0 commit comments

Comments
 (0)