Skip to content

Commit 7089645

Browse files
committed
hotfix: improve fatal problems #4
1 parent 6c8b916 commit 7089645

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

generator.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,13 @@ func (repo *{{ .RepositoryStructName }}) List(ctx context.Context, req *{{ .Stru
382382
383383
for i, k := range keys {
384384
if k != nil {
385+
{{- if eq .KeyFieldType "int64" }}
385386
subjects[i].ID = k.ID
387+
{{ else if eq .KeyFieldType "string" }}
388+
subjects[i].ID = k.Name
389+
{{ else }}
390+
subjects[i].ID = k
391+
{{ end }}
386392
}
387393
}
388394

0 commit comments

Comments
 (0)