代码自动化生成支持预览功能
This commit is contained in:
@@ -68,6 +68,7 @@ func PreviewTemp(autoCode model.AutoCodeStruct) (map[string]string, error) {
|
||||
}
|
||||
builder := strings.Builder{}
|
||||
builder.WriteString("```")
|
||||
|
||||
if ext != "" && strings.Contains(ext, ".") {
|
||||
builder.WriteString(strings.Replace(ext, ".", "", -1))
|
||||
}
|
||||
@@ -79,7 +80,7 @@ func PreviewTemp(autoCode model.AutoCodeStruct) (map[string]string, error) {
|
||||
builder.Write(data)
|
||||
builder.WriteString("\n\n```")
|
||||
|
||||
pathArr := strings.Split(value.autoCodePath,"\\")
|
||||
pathArr := strings.Split(value.autoCodePath, "\\")
|
||||
ret[pathArr[1]+"-"+pathArr[3]] = builder.String()
|
||||
_ = f.Close()
|
||||
|
||||
|
Reference in New Issue
Block a user