import { defHttp } from '/@/utils/http/axios'; import { setParams } from '/@/utils/index'; enum Api { ${frontModuleName}${busNameFirstUpper}QueryPage = '${pathPrefix}/query/page', ${frontModuleName}${busNameFirstUpper}Detail = '${pathPrefix}/detail', ${frontModuleName}${busNameFirstUpper}Add = '${pathPrefix}/add', ${frontModuleName}${busNameFirstUpper}Edit = '${pathPrefix}/edit', ${frontModuleName}${busNameFirstUpper}Remove = '${pathPrefix}/removeByIds', } /** * * @author ${authorName} * @date ${genTime} * @description: 根据条件查询${functionName}列表,权限 - ${backendModuleName}:${busName}:query * @method: POST * @param: <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].queryWhether!=null && configList[i].queryWhether ) { %> * {${configList[i].fieldJavaType}} ${configList[i].fieldNameCamelCase} ${configList[i].queryType} ${configList[i].fieldRemark} <% } %> <% } %> * @return: <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase!= "createTime" && configList[i].fieldNameCamelCase != "createBy" && configList[i].fieldNameCamelCase != "updateTime" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" && configList[i].whetherTable) {%> * {${configList[i].fieldJavaType}} ${configList[i].fieldNameCamelCase} ${configList[i].fieldRemark} <% } %> <% } %> */ export const ${frontModuleName}${busNameFirstUpper}QueryPage = (params?: object) => { return defHttp.post({ url: Api.${frontModuleName}${busNameFirstUpper}QueryPage, params: setParams(params) }); }; /** * * @author ${authorName} * @date ${genTime} * @description: 根据id查询${functionName}详细信息,权限 - ${backendModuleName}:${busName}:query * @method: GET * @param: id ${functionName}主键id * @return: <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase!= "createTime" && configList[i].fieldNameCamelCase != "createBy" && configList[i].fieldNameCamelCase != "updateTime" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" && configList[i].whetherTable) {%> * {${configList[i].fieldJavaType}} ${configList[i].fieldNameCamelCase} ${configList[i].fieldRemark} <% } %> <% } %> */ export const ${frontModuleName}${busNameFirstUpper}Detail = (id: string) => { return defHttp.get({ url: Api.${frontModuleName}${busNameFirstUpper}Detail + '/' + id }); }; /** * * @author ${authorName} * @date ${genTime} * @description: 添加${functionName},权限 - ${backendModuleName}:${busName}:add * @method: POST * @param: <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase!= "createTime" && configList[i].fieldNameCamelCase != "createBy" && configList[i].fieldNameCamelCase != "updateTime" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" && configList[i].whetherAddUpdate) {%> * {${configList[i].fieldJavaType}} ${configList[i].fieldNameCamelCase} ${configList[i].fieldRemark} <% } %> <% } %> * @return: * 0 添加失败 * 1 添加成功 */ export const ${frontModuleName}${busNameFirstUpper}Add = (params?: object) => { return defHttp.post({ url: Api.${frontModuleName}${busNameFirstUpper}Add, params: params }); }; /** * * @author ${authorName} * @date ${genTime} * @description: 通过主键id编辑${functionName},权限 - ${backendModuleName}:${busName}:edit * @method: POST * @param: <% for(var i = 0; i < configList.~size; i++) { %> <% if(configList[i].fieldNameCamelCase!= "createTime" && configList[i].fieldNameCamelCase != "createBy" && configList[i].fieldNameCamelCase != "updateTime" &&configList[i].fieldNameCamelCase != "updateBy" && configList[i].fieldNameCamelCase != "tenantId" && configList[i].fieldNameCamelCase!= "deleted" && configList[i].whetherAddUpdate) {%> * {${configList[i].fieldJavaType}} ${configList[i].fieldNameCamelCase} ${configList[i].fieldRemark} <% } %> <% } %> * @return: * 0 编辑失败 * 1 编辑成功 */ export const ${frontModuleName}${busNameFirstUpper}Edit = (params?: object) => { return defHttp.post({ url: Api.${frontModuleName}${busNameFirstUpper}Edit, params: params }); }; /** * @description: 删除,权限 - ${backendModuleName}:${busName}:remove * @method: POST */ export const ${frontModuleName}${busNameFirstUpper}Remove = (params: Array) => { return defHttp.post({ url: Api.${frontModuleName}${busNameFirstUpper}Remove, params: params }); };