Skip to content

Commit

Permalink
chore: 优化代码生成模板
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed May 2, 2024
1 parent dc92731 commit def831f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ export interface ${classNamePrefix}DetailResp {
updateUserString: string
</#if>
}
export interface ${classNamePrefix}Query extends PageQuery {
export interface ${classNamePrefix}Query {
<#if fieldConfigs??>
<#list fieldConfigs as fieldConfig>
<#if fieldConfig.showInQuery>
${fieldConfig.fieldName}: string
</#if>
</#list>
</#if>
sort: Array<string>
}
export interface ${classNamePrefix}PageQuery extends ${classNamePrefix}Query, PageQuery {}

/** @desc 查询${businessName}列表 */
export function list${classNamePrefix}(query: ${classNamePrefix}Query) {
export function list${classNamePrefix}(query: ${classNamePrefix}PageQuery) {
return http.get<PageRes<${classNamePrefix}Resp[]>>(`${'$'}{BASE_URL}`, query)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const columns: TableInstanceColumns[] = [
}
]
const queryForm: ${classNamePrefix}Query = reactive({
const queryForm = reactive<${classNamePrefix}Query>({
<#list fieldConfigs as fieldConfig>
<#if fieldConfig.showInQuery>
${fieldConfig.fieldName}: undefined,
Expand Down

0 comments on commit def831f

Please sign in to comment.