feat: completed development wecom message
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user