refactor(codegen): 优化代码生成模板

- 将 API路径和权限标识改为使用 kebab-case 风格- 优化了部分代码注释和命名
- 优化代码生成的注释,增加返回值解释
This commit is contained in:
Theo
2025-04-02 15:21:55 +08:00
parent ded1a527ea
commit abb67a0bf9
7 changed files with 29 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
import request from "@/utils/request";
const ${entityName.toUpperCase()}_BASE_URL = "/api/v1/${lowerFirstEntityName}s";
const ${entityName.toUpperCase()}_BASE_URL = "/api/v1/${kebabCaseEntityName}";
const ${entityName}API = {
/** 获取${businessName}分页数据 */
@@ -24,7 +24,11 @@ const ${entityName}API = {
});
},
/** 添加${businessName}*/
/**
* 添加${businessName}
*
* @param data ${businessName}表单数据
*/
add(data: ${entityName}Form) {
return request({
url: `${${entityName.toUpperCase()}_BASE_URL}`,