feat: 添加代码生成功能
This commit is contained in:
37
templates/typescript/type.d.ts.jinja
Normal file
37
templates/typescript/type.d.ts.jinja
Normal file
@@ -0,0 +1,37 @@
|
||||
/** {{ description }}信息 */
|
||||
export interface {{ class_name }}Info {
|
||||
{% for column in columns if column.is_list %}
|
||||
/** {{ column.column_comment }} */
|
||||
{{ column.python_name }}: {{ column.typescript_type }};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
/** 获取{{ description }}列表参数 */
|
||||
export interface Get{{ class_name }}ListParams {
|
||||
|
||||
/** 当前页 */
|
||||
page: number;
|
||||
|
||||
/** 每页数量 */
|
||||
pageSize: number;
|
||||
{% for column in columns if column.is_query %}
|
||||
/** {{ column.column_comment }} */
|
||||
{{ column.python_name }}?: string;
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
/** 添加{{ description }}数据参数 */
|
||||
export interface Add{{ class_name }}Params {
|
||||
{% for column in columns if column.is_insert %}
|
||||
/** {{ column.column_comment }} */
|
||||
{{ column.python_name }}{% if not column.is_required %}?{% endif %}: {{ column.typescript_type }};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
/** 更新{{ description }}数据参数 */
|
||||
export interface Update{{ class_name }}Params {
|
||||
{% for column in columns if column.is_edit %}
|
||||
/** {{ column.column_comment }} */
|
||||
{{ column.python_name }}{% if not column.is_required %}?{% endif %}: {{ column.typescript_type }};
|
||||
{% endfor %}
|
||||
}
|
||||
Reference in New Issue
Block a user