Pre Merge pull request !17 from 月祈风华/dev

This commit is contained in:
月祈风华 2025-07-12 17:44:46 +00:00 committed by Gitee
commit d6d7c083e7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,44 +1,51 @@
#set($BaseEntity = ['createDept', 'createBy', 'createTime', 'updateBy', 'updateTime']) #set($BaseEntity = ['createDept', 'createBy', 'createTime', 'updateBy', 'updateTime'])
#set($ModuleName = $moduleName.substring(0, 1).toUpperCase() + $moduleName.substring(1)) #set($ModuleName = $moduleName.substring(0, 1).toUpperCase() + $moduleName.substring(1))
/** /**
* namespace ${ModuleName} * Namespace Api
* *
* backend api module: "${ModuleName}" * All backend api type
*/ */
namespace ${ModuleName} { declare namespace Api {
/** ${businessname} */ /**
type ${BusinessName} = Common.CommonRecord<{ * namespace ${ModuleName}
#foreach($column in $columns)#if(!$BaseEntity.contains($column.javaField)) *
/** $column.columnComment */ * backend api module: "${ModuleName}"
$column.javaField:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) CommonType.IdType; #elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; #elseif($column.javaType == 'Boolean') boolean; #else string; #end */
#end#end namespace ${ModuleName} {
}>; /** ${businessname} */
type ${BusinessName} = Common.CommonRecord<{
#foreach($column in $columns)#if(!$BaseEntity.contains($column.javaField))
/** $column.columnComment */
$column.javaField:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) CommonType.IdType; #elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number; #elseif($column.javaType == 'Boolean') boolean; #else string; #end
#end#end
}>;
/** ${businessname} search params */ /** ${businessname} search params */
type ${BusinessName}SearchParams = CommonType.RecordNullable< type ${BusinessName}SearchParams = CommonType.RecordNullable<
Pick< Pick<
Api.${ModuleName}.${BusinessName}, Api.${ModuleName}.${BusinessName},
#foreach($column in $columns) #foreach($column in $columns)
#if($column.query && $column.queryType != 'BETWEEN') #if($column.query && $column.queryType != 'BETWEEN')
| '${column.javaField}' | '${column.javaField}'
#end #end
#end #end
> & > &
Api.Common.CommonSearchParams Api.Common.CommonSearchParams
>; >;
/** ${businessname} operate params */ /** ${businessname} operate params */
type ${BusinessName}OperateParams = CommonType.RecordNullable< type ${BusinessName}OperateParams = CommonType.RecordNullable<
Pick< Pick<
Api.${ModuleName}.${BusinessName}, Api.${ModuleName}.${BusinessName},
#foreach($column in $columns) #foreach($column in $columns)
#if($column.insert || $column.edit) #if($column.insert || $column.edit)
| '${column.javaField}' | '${column.javaField}'
#end #end
#end #end
> >
>; >;
/** ${businessname} list */ /** ${businessname} list */
type ${BusinessName}List = Api.Common.PaginatingQueryRecord<${BusinessName}>; type ${BusinessName}List = Api.Common.PaginatingQueryRecord<${BusinessName}>;
}
} }