3
0
corteza/codegen/templates/http_structs.tpl
2018-12-04 15:26:51 +01:00

25 lines
597 B
Smarty

package {package}
{load warning_short.tpl}
{if !empty($imports)}
import (
{foreach ($imports as $import)}
{import}{EOL}{/foreach}
)
{/if}
{if !empty($structs)}
type (
{foreach $structs as $struct}
// {api.title} - {api.description}
{struct.name} struct {
{foreach $struct.fields as $field}
{field.name} {field.type} `json:"{if $field.json}{$field.json}{elseif $field.db}{$field.db}{else}{$field.name|decamel}{/if}{if $field.omitempty},omitempty{/if}" db:"{if $field.db}{$field.db}{else}{$field.name|decamel}{/if}"`{newline}
{/foreach}
}
{/foreach}
)
{/if}