Add im channel Mattermost

This commit is contained in:
Austin Xia
2026-03-27 11:07:09 +08:00
committed by lyingbug
parent 72dfb9ce75
commit 463f40fadc
14 changed files with 874 additions and 26 deletions
+27
View File
@@ -0,0 +1,27 @@
package mattermost
import (
"encoding/json"
"fmt"
"net/url"
)
func parseFormBody(body []byte) (url.Values, error) {
values, err := url.ParseQuery(string(body))
if err != nil {
return nil, fmt.Errorf("parse form: %w", err)
}
return values, nil
}
func jsonArrayFromCSV(csv string) []byte {
parts := splitFileIDs(csv)
if len(parts) == 0 {
return []byte("[]")
}
b, err := json.Marshal(parts)
if err != nil {
return []byte("[]")
}
return b
}