Skip to content

添加GetDataTypeMap方法,根据配置获取当前数据类型映射关系 #1348

@ez4bk

Description

@ez4bk

Feature Description

是否应该在 gen 中添加 GetDataTypeMap 方法,返回当根据用户配置后产生的完整的数据类型映射Map?
或者在全局变量中,添加一张 DefaultDataTypeMap,来展示 GenTool 默认的映射关系?

Motivation

当前正在 Gen 的基础上拓展我自己的业务Dao层的代码生成方法,但是需要完整的数据类型映射关系。在我个人配置中打开了 FieldWithTypeTag, FieldSignable, FieldWithIndexTag,并配置数据库列类型 json 为 datatypes.JSON

dataMap["json"] = func(columnType gorm.ColumnType) string {
    return "datatypes.JSON"
}

我需要完整的数据类型映射 Map 才能完成我自己的生成方法,所以希望能够添加一个 GetDataTypeMap 方法,返回根据用户配置后的完整 Map

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions