Browse Source

代码自动化生成支持预览功能

main
pixel 4 years ago
parent
commit
5b2de06c43
  1. 3
      server/service/sys_auto_code.go

3
server/service/sys_auto_code.go

@ -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()

Loading…
Cancel
Save