feat(codegen): 代码生成新增 AI 配置推断并迁移模板资源
- 模板与外部文件移至 resources/codegen、excel、ip2region - 新增 AI 配置推断接口、表单与返回对象 - 字典项与菜单 SQL、IP 工具、日志配置调整 - docker-compose 与英文 README 更新 - 版本 4.11.0
This commit is contained in:
1 parent
9fc49583d9
commit
607b6c7bb3
40 files changed
+313
-85
No files matched your search
@@ -0,0 +1,51 @@
|
||||
import request from "@/utils/request";
|
||||
import type { ${entityName}Form, ${entityName}QueryParams, ${entityName}Item } from "./types";
|
||||
import type { PageResult } from "@/api/common";
|
||||
|
||||
const ${entityUpperSnake}_BASE_URL = "/api/v1/${entityKebab}";
|
||||
|
||||
const ${entityName}API = {
|
||||
/** 获取${businessName}分页数据 */
|
||||
getPage(queryParams?: ${entityName}QueryParams) {
|
||||
return request<unknown, PageResult<${entityName}Item>>({
|
||||
url: `${${entityUpperSnake}_BASE_URL}`,
|
||||
method: "get",
|
||||
params: queryParams,
|
||||
});
|
||||
},
|
||||
/** 获取${businessName}表单数据 */
|
||||
getFormData(id: string) {
|
||||
return request<unknown, ${entityName}Form>({
|
||||
url: `${${entityUpperSnake}_BASE_URL}/${id}/form`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
/** 新增${businessName} */
|
||||
create(data: ${entityName}Form) {
|
||||
return request({
|
||||
url: `${${entityUpperSnake}_BASE_URL}`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
/** 更新${businessName} */
|
||||
update(id: string, data: ${entityName}Form) {
|
||||
return request({
|
||||
url: `${${entityUpperSnake}_BASE_URL}/${id}`,
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
},
|
||||
/** 批量删除${businessName},多个以英文逗号(,)分割 */
|
||||
deleteByIds(ids: string) {
|
||||
return request({
|
||||
url: `${${entityUpperSnake}_BASE_URL}/${ids}`,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default ${entityName}API;
|
||||
|
||||
// 重导出类型
|
||||
export * from "./types";
|
||||
Reference in new issue
Block a user