From 4d45d7f037bc2a319b6f100156f0fadce25d09ce Mon Sep 17 00:00:00 2001 From: mlogclub Date: Tue, 21 Apr 2026 18:08:03 +0800 Subject: [PATCH] feat(wxwork): refactor truncateRunes function to be a method of wxWorkNotifyService --- internal/services/wxwork_notify_service.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/wxwork_notify_service.go b/internal/services/wxwork_notify_service.go index c994660..f3a3b56 100644 --- a/internal/services/wxwork_notify_service.go +++ b/internal/services/wxwork_notify_service.go @@ -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 "" }