@@ -171,7 +171,7 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
171
171
body , _ = sjson .Set (body , path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipType" , "constant" )
172
172
body , _ = sjson .Set (body , path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipValue" , data .{{toGoName .TfName }}.Value {{.Type }}())
173
173
{{- if and ( .RequiresConstAndVar ) (.Variable ) }}
174
- body , _ = sjson .Set (body , path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , data .{{toGoName .TfName }}Variable .ValueString ())
174
+ body , _ = sjson .Set (body , path + "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , data .{{toGoName .TfName }}Variable.Value {{. Type }} ())
175
175
{{end }}
176
176
}
177
177
{{- else if and (eq .Type "Bool" ) (not .NodeOnlyContainer )}}
@@ -254,6 +254,9 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
254
254
itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipObjectType" , "{{.ObjectType}}" )
255
255
itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipType" , "variableName" )
256
256
itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , item .{{toGoName .TfName }}Variable .ValueString ())
257
+ {{- if .RequiresConstAndVar }}
258
+ itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipValue" , item .{{toGoName .TfName }}.Value {{.Type }}())
259
+ {{end }}
257
260
} else
258
261
{{- end }} if item .{{toGoName .TfName }}.IsNull () {
259
262
{{- if and (not .Mandatory ) (not .ExcludeIgnore )}}
@@ -268,6 +271,9 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
268
271
itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipObjectType" , "{{.ObjectType}}" )
269
272
itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipType" , "constant" )
270
273
itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipValue" , item .{{toGoName .TfName }}.Value {{.Type }}())
274
+ {{- if and ( .RequiresConstAndVar ) (.Variable ) }}
275
+ itemBody , _ = sjson .Set (itemBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , item .{{toGoName .TfName }}Variable.Value {{.Type }}())
276
+ {{end }}
271
277
}
272
278
{{- else if and (eq .Type "Bool" ) (not .NodeOnlyContainer )}}
273
279
{{if .Variable }}
@@ -349,6 +355,9 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
349
355
itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipObjectType" , "{{.ObjectType}}" )
350
356
itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipType" , "variableName" )
351
357
itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , childItem .{{toGoName .TfName }}Variable .ValueString ())
358
+ {{- if .RequiresConstAndVar }}
359
+ itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipValue" , childItem .{{toGoName .TfName }}.Value {{.Type }}())
360
+ {{end }}
352
361
} else
353
362
{{- end }} if childItem .{{toGoName .TfName }}.IsNull () {
354
363
{{- if and (not .Mandatory ) (not .ExcludeIgnore )}}
@@ -363,6 +372,9 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
363
372
itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipObjectType" , "{{.ObjectType}}" )
364
373
itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipType" , "constant" )
365
374
itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipValue" , childItem .{{toGoName .TfName }}.Value {{.Type }}())
375
+ {{- if and ( .RequiresConstAndVar ) (.Variable ) }}
376
+ itemChildBody , _ = sjson .Set (itemChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , childItem .{{toGoName .TfName }}Variable.Value {{.Type }}())
377
+ {{end }}
366
378
}
367
379
{{- else if and (eq .Type "Bool" ) (not .NodeOnlyContainer )}}
368
380
{{if .Variable }}
@@ -444,6 +456,9 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
444
456
itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipObjectType" , "{{.ObjectType}}" )
445
457
itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipType" , "variableName" )
446
458
itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , childChildItem .{{toGoName .TfName }}Variable .ValueString ())
459
+ {{- if .RequiresConstAndVar }}
460
+ itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipValue" , childChildItem .{{toGoName .TfName }}.Value {{.Type }}())
461
+ {{end }}
447
462
} else
448
463
{{- end }} if childChildItem .{{toGoName .TfName }}.IsNull () {
449
464
{{- if and (not .Mandatory ) (not .ExcludeIgnore )}}
@@ -458,6 +473,9 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string {
458
473
itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipObjectType" , "{{.ObjectType}}" )
459
474
itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipType" , "constant" )
460
475
itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipValue" , childChildItem .{{toGoName .TfName }}.Value {{.Type }}())
476
+ {{- if and ( .RequiresConstAndVar ) (.Variable ) }}
477
+ itemChildChildBody , _ = sjson .Set (itemChildChildBody , "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}." + "vipVariableName" , childChildItem .{{toGoName .TfName }}Variable.Value {{.Type }}())
478
+ {{end }}
461
479
}
462
480
{{- else if and (eq .Type "Bool" ) (not .NodeOnlyContainer )}}
463
481
{{if .Variable }}
0 commit comments