From bd7b9e73146afacdb19b9fe6729aa7a508360208 Mon Sep 17 00:00:00 2001 From: Ymnuk Date: Fri, 1 Sep 2023 12:32:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8E=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/templ/tmpl/backend/db/model/model.tmpl | 6 +++--- .../angular/src/app/module/primeng/primeng.module.ts.tmpl | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/templ/tmpl/backend/db/model/model.tmpl b/lib/templ/tmpl/backend/db/model/model.tmpl index 0502e6c..1272752 100644 --- a/lib/templ/tmpl/backend/db/model/model.tmpl +++ b/lib/templ/tmpl/backend/db/model/model.tmpl @@ -17,7 +17,7 @@ type {{ fieldNamePrepare .Name }} struct { {{ end }} {{ range $index, $field := .Fields }} - {{ fieldName $field }} {{ fieldType $field }} `gorm:"column:{{ fieldNameLowerPrepare $field.Name }};comment:{{ $field.Description }}" json:"{{ fieldNameLowerPrepare $field.Name }},omitenpty"` + {{ fieldName $field }} {{ fieldType $field }} `gorm:"column:{{ fieldNameLowerPrepare $field.Name }};comment:{{ $field.Description }}" json:"{{ fieldJsonNameStr $field.Name }},omitenpty"` {{ end }} {{ range $index, $field := .Children }} @@ -25,8 +25,8 @@ type {{ fieldNamePrepare .Name }} struct { {{ end }} {{ range $index, $field := .FkFields }} - {{ fieldName $field }}ID {{ fieldTypeParentTable $field }} `gorm:"column:{{ fieldNameLowerPrepare $field.Name }}_id;comment:{{ $field.Description }}" json:"{{ fieldNameLowerPrepare $field.Name }}Id,omitenpty"` - {{ fieldName $field }} *{{ if eq $field.Name "Parent" }}{{ fieldNamePrepare $.Name }}{{ else }}{{ fieldType $field }}{{ end }} `json:"{{ fieldNameLowerPrepare $field.Name }},omitenpty"` + {{ fieldName $field }}ID {{ fieldTypeParentTable $field }} `gorm:"column:{{ fieldNameLowerPrepare $field.Name }}_id;comment:{{ $field.Description }}" json:"{{ fieldJsonNameStr $field.Name }}Id,omitenpty"` + {{ fieldName $field }} *{{ if eq $field.Name "Parent" }}{{ fieldNamePrepare $.Name }}{{ else }}{{ fieldType $field }}{{ end }} `json:"{{ fieldJsonNameStr $field.Name }},omitenpty"` {{ end }} } diff --git a/lib/templ/tmpl/frontend/angular/src/app/module/primeng/primeng.module.ts.tmpl b/lib/templ/tmpl/frontend/angular/src/app/module/primeng/primeng.module.ts.tmpl index 2f1c80b..7643e9a 100644 --- a/lib/templ/tmpl/frontend/angular/src/app/module/primeng/primeng.module.ts.tmpl +++ b/lib/templ/tmpl/frontend/angular/src/app/module/primeng/primeng.module.ts.tmpl @@ -31,6 +31,7 @@ import { MultiSelectModule } from 'primeng/multiselect'; import { ColorPickerModule } from 'primeng/colorpicker'; import { AnimateModule } from 'primeng/animate'; import { StyleClassModule } from 'primeng/styleclass'; +import { TreeTableModule } from 'primeng/treetable'; const modules = [ RippleModule, @@ -63,7 +64,8 @@ const modules = [ MultiSelectModule, ColorPickerModule, AnimateModule, - StyleClassModule + StyleClassModule, + TreeTableModule ]; @NgModule({