codegen

package
v0.0.0-...-ec457a0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TBaseInfo

type TBaseInfo struct {
	DesignerVersion string // 生成工具版本
	DateTime        string // 生成时间
	UIFile          string // UI 文件
	UserFile        string // 用户文件
}

基础信息

type TComponentData

type TComponentData struct {
	Name       string               // 组件名称
	ClassName  string               // 组件类名
	Mod        string               // 组件所属模块
	Type       consts.ComponentType // 组件类型
	Properties []TPropertyData      // 组件属性
	Parent     *TComponentData      // 组件所属父类
	Children   []*TComponentData    // 子组件列表
}

组件数据

func (*TComponentData) GoFieldName

func (m *TComponentData) GoFieldName() string

模板调用函数 - 返回组件字段名

func (*TComponentData) GoIntfName

func (m *TComponentData) GoIntfName() string

模板调用函数 - 返回组件在Go定义的接口名

func (*TComponentData) GoNewObject

func (m *TComponentData) GoNewObject() string

模板调用函数 - 返回组件在Go创建方法名

func (*TComponentData) GoSetObjectParent

func (m *TComponentData) GoSetObjectParent() string

模板调用函数 - 返回组件在Go创建方法名

type TFormData

type TFormData struct {
	BaseInfo    *TBaseInfo            // 基础信息
	PackageName string                // 包名
	Imports     *tool.HashSet[string] // 导入包
	Form        *TComponentData       // 窗体根组件节点
}

窗体数据

func (*TFormData) GoGetImports

func (m *TFormData) GoGetImports() string

模板调用函数 - 返回当前使用的包

func (*TFormData) IncludePackage

func (m *TFormData) IncludePackage()

包含的包 该函数在渲染之前执行, 获取当前所依赖的模块包 根据不同的属性和组件所属模板区分包

type TListenFileInfo

type TListenFileInfo struct {
	Id      int       // 窗体 id
	Path    string    // 文件路径
	ModTime time.Time // 修改时间
	Exist   bool      // 是否存在
}

type TPropertyData

type TPropertyData struct {
	Name   string                  // 属性名称
	Value  any                     // 属性值
	Type   consts.PropertyDataType // 属性类型
	NoCode bool                    // 是否生成代码, true: 不生成, false 生成
}

属性数组

func (*TPropertyData) GoPropertySet

func (m *TPropertyData) GoPropertySet(comp *TComponentData, form *TFormData) string

模板调用函数 - 设置对象属性

Jump to

Keyboard shortcuts

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