feat(wxwork): refactor truncateRunes function to be a method of wxWorkNotifyService

This commit is contained in:
mlogclub
2026-04-21 18:08:03 +08:00
parent beebf131c8
commit 4d45d7f037
+4 -4
View File
@@ -117,11 +117,11 @@ func (s *wxWorkNotifyService) buildTextContent(title, body string) string {
case title == "" && body == "":
return ""
case title == "":
return truncateRunes(body, 1024)
return s.truncateRunes(body, 1024)
case body == "":
return truncateRunes(title, 1024)
return s.truncateRunes(title, 1024)
default:
return truncateRunes(title+"\n\n"+body, 1024)
return s.truncateRunes(title+"\n\n"+body, 1024)
}
}
@@ -135,7 +135,7 @@ func (s *wxWorkNotifyService) normalizeDuplicateCheckInterval(value int) int {
return value
}
func truncateRunes(value string, max int) string {
func (s *wxWorkNotifyService) truncateRunes(value string, max int) string {
if max <= 0 {
return ""
}