templates.front.api.ts.ftl Maven / Gradle / Ivy
import {get, postJ} from "@/request";
import {I${modelName}} from "@/apis/${pathName}/types";
import {IPageRes} from "@/apis/page";
/**
* 获取列表
*/
export const get${modelName}PageApi = (param: I${modelName}) => get>("/${folderName}/${apiPathName}/query", param)
<#if webGeneratorVo.isSqlSentence==1>
<#if webGeneratorVo.pageAttribute?contains("add")>
/**
* 添加
*/
export const create${modelName}Api = (data: I${modelName}) => postJ("/${folderName}/${apiPathName}/create", data)
#if>
<#if webGeneratorVo.pageAttribute?contains("update")>
/**
* 修改
*/
export const modify${modelName}Api = (data: I${modelName}) => postJ("/${folderName}/${apiPathName}/modify", data)
#if>
<#if webGeneratorVo.pageAttribute?contains("delete")>
/**
* 删除
* @param id
*/
export const remove${modelName}Api = (id: string) => get("/${folderName}/${apiPathName}/remove/" + id)
#if>
/**
* 查询详情
* @param id
*/
export const get${modelName}DetailApi = (id: string) => get("/${folderName}/${apiPathName}/detail/" + id)
#if>