todart

package
v0.0.0-...-3a0ec97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenModel

func GenModel(destFile string, jsonStr string) error

Types

type Class

type Class struct {
	Name   string
	Fields []Field
}

func FieldToClass

func FieldToClass(clsName string, listField []myjson.FieldValue) []Class

type Field

type Field struct {
	Key      string
	Name     string
	Type     string
	ItemName string //基于约定:itemName
	Value    any
}

func (*Field) GetItemValueType

func (self *Field) GetItemValueType() string

针对map ,list 获取children 的类型

type TempModel

type TempModel struct {
	*template.Template
	// contains filtered or unexported fields
}

func NewTempModel

func NewTempModel(clsName string, fields []Field) (*TempModel, error)

func (*TempModel) FromMapFieldTemplate

func (self *TempModel) FromMapFieldTemplate(f Field) string

func (*TempModel) ToCode

func (self *TempModel) ToCode() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL