feat: completed development wecom message

This commit is contained in:
zzw
2026-09-18 17:39:48 +08:00
parent dd460f6be2
commit 1ca44d25df
57 changed files with 1754 additions and 1412 deletions
@@ -1,25 +1,21 @@
package utils
import (
"base-service/app/dao"
"base-service/pkg/wecom/message"
"base-service/utils"
"fmt"
"lone-services/pkg/utils"
"lone-services/pkg/wecom/message"
)
func GetMapString(data map[string]interface{}, key string) string {
val, ok := data[key]
if !ok || val == nil {
return dao.StringEmpty
return utils.StringEmpty
}
return fmt.Sprintf("%v", val)
}
func GetExtString(ext map[string]any, key string) string {
v, ok := ext[key].(string)
if !ok || v == "" {
return "无"
@@ -38,18 +34,15 @@ func BuildContent(kvPairs ...struct{ Key, Value string }) []message.HorizontalCo
}
content := make([]message.HorizontalContent, 0, inputCount+fixedItems)
for i := 0; i < inputCount; i++ {
content = append(content, message.HorizontalContent{
KeyName: kvPairs[i].Key,
Value: kvPairs[i].Value,
})
}
content = append(content, message.HorizontalContent{
KeyName: "审核时间",
Value: utils.Now().Format(),
})
return content
}