Skip to content

Commit

Permalink
fix namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
hengwei-test committed Mar 23, 2024
1 parent d3129f4 commit 04e46ff
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions cmd/gobatis/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,11 @@ func initInsertImplFunc() {
_, {{$errName}} {{if not $rerr.Name -}}:{{- end -}}=
{{- end}} impl.session.Insert(
{{- .contextArg -}}
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1225,7 +1229,11 @@ func initUpdateImplFunc() {
_, {{$errName}} {{if not $rerr.Name -}}:{{- end -}}=
{{- end}} impl.session.Update(
{{- .contextArg -}}
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1272,7 +1280,11 @@ func initDeleteImplFunc() {
_, {{$errName}} {{if not $rerr.Name -}}:{{- end -}}=
{{- end}} impl.session.Delete(
{{- .contextArg -}}
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1321,7 +1333,11 @@ func initSelectCallbackImplFunc() {
{{- end}}
{{$resultName}} := impl.session.{{$selectMethodName}}(
{{- .contextArg -}}
"{{.itf.Name}}.{{.method.Name}}",
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1410,7 +1426,11 @@ func initSelectOneImplFunc() {
{{$errName}} {{if not $rerr.Name -}}:{{- end -}}= impl.session.{{$SelectOne}}(
{{- .contextArg -}}
"{{.itf.Name}}.{{.method.Name}}",
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1532,7 +1552,11 @@ func initSelectArrayImplFunc() {
{{- end}}
results := impl.session.Select(
{{- .contextArg -}}
"{{.itf.Name}}.{{.method.Name}}",
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1584,7 +1608,11 @@ func initSelectBasicMapImplFunc() {
results := impl.session.Select(
{{- .contextArg -}}
"{{.itf.Name}}.{{.method.Name}}",
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1656,7 +1684,11 @@ func initSelectOneForMutiObjectImplFunc() {
{{$rerr.Name}} = impl.session.SelectOne(
{{- .contextArg -}}
"{{.itf.Name}}.{{.method.Name}}",
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down Expand Up @@ -1755,7 +1787,11 @@ func initSelectArrayForMutiObjectImplFunc() {
{{$rerr.Name}} = impl.session.Select(
{{- .contextArg -}}
"{{.itf.Name}}.{{.method.Name}}",
{{if .itf.UseNamespace }}
"{{.itf.Namespace}}.{{.itf.Name}}.{{.method.Name}}",
{{- else -}}
"{{.itf.Name}}.{{.method.Name}}",
{{- end -}}
{{- if .method.Params.List}}
[]string{
{{- range $param := .method.Params.List}}
Expand Down

0 comments on commit 04e46ff

Please sign in to comment.