40 lines
1.7 KiB
Plaintext
40 lines
1.7 KiB
Plaintext
#set($ModuleName=$moduleName.substring(0, 1).toUpperCase() + $moduleName.substring(1))
|
||
/**
|
||
* namespace ${ModuleName}
|
||
*
|
||
* backend api module: "${ModuleName}"
|
||
*/
|
||
namespace ${ModuleName} {
|
||
/** ${businessName} */
|
||
type ${BusinessName} = Common.CommonRecord<{
|
||
#foreach($column in $columns)#if($column.insert || $column.edit)
|
||
/** $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 */
|
||
type ${BusinessName}SearchParams = CommonType.RecordNullable<
|
||
Pick<
|
||
Api.${ModuleName}.${BusinessName},
|
||
#foreach($column in $columns)
|
||
#if($column.query)
|
||
#set($dictType=$column.dictType)
|
||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||
#if($parentheseIndex != -1)
|
||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||
#else
|
||
#set($comment=$column.columnComment)
|
||
#end
|
||
#if($foreach.hasNext) |#end '${column.javaField}'
|
||
#end
|
||
#end
|
||
> &
|
||
Common.CommonSearchParams
|
||
>;
|
||
|
||
/** ${businessName} list */
|
||
type ${BusinessName}List = Common.PaginatingQueryRecord<${BusinessName}>;
|
||
}
|