Skip to content

Commit 78164d1

Browse files
author
潘朝思
committed
feat: update description
1 parent a73cd19 commit 78164d1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/app/cronjob/generate_note.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"sort"
88
"strconv"
9+
"strings"
910

1011
log "github.com/sirupsen/logrus"
1112
"github.com/spf13/viper"
@@ -70,7 +71,14 @@ func GenerateNote(ctx context.Context) {
7071
log.Errorf("%+v", err)
7172
continue
7273
}
73-
content := "### " + p.Name + "\n[OJ链接](" + p.Link + ")\n\n" + p.Content + "\n### 解答\n" + p.Result
74+
content := "### " + p.Name + "\n"
75+
if p.Link != "" && !strings.Contains(p.Link, "chaosi-zju.com") {
76+
content += "[OJ链接](" + p.Link + ")\n\n"
77+
}
78+
if p.Content != "" && p.Type == "interview" {
79+
content += "### 一句话总结\n"
80+
}
81+
content += p.Content + "\n### 解答\n" + p.Result
7482
_, err = io.WriteString(f, content)
7583
if err != nil {
7684
log.Errorf("k1: %s, k2: %s, not exist", k1, k2)

0 commit comments

Comments
 (0)