自动生成文件名称修改为 前端为小驼峰 后端为下划线

This commit is contained in:
pixel
2021-06-17 12:12:31 +08:00
parent f6865ba6ba
commit 74d6c237cd
6 changed files with 26 additions and 16 deletions
+8 -1
View File
@@ -360,8 +360,15 @@ func getNeedList(autoCode *model.AutoCodeStruct) (dataList []tplData, fileList [
origFileName := strings.TrimSuffix(trimBase[lastSeparator+1:], ".tpl")
firstDot := strings.Index(origFileName, ".")
if firstDot != -1 {
var fileName string
if origFileName[firstDot:] !=".go"{
fileName = autoCode.PackageName+origFileName[firstDot:]
}else{
fileName = autoCode.HumpPackageName+origFileName[firstDot:]
}
dataList[index].autoCodePath = filepath.Join(autoPath, trimBase[:lastSeparator], autoCode.PackageName,
origFileName[:firstDot], autoCode.PackageName+origFileName[firstDot:])
origFileName[:firstDot], fileName)
}
}