This commit is contained in:
zhaoxiaorong 2025-04-11 18:06:08 +08:00
parent d691648916
commit c08950c10a
1 changed files with 2 additions and 2 deletions

View File

@ -6,11 +6,11 @@ import (
"net/http" "net/http"
) )
func New(endpoint string, data LogRequest) error { func New(endpoint string, data []*LogItem) error {
go PostLog(data, endpoint) go PostLog(data, endpoint)
return nil return nil
} }
func PostLog(data LogRequest, endpoint string) (resp *http.Response, err error) { func PostLog(data []*LogItem, endpoint string) (resp *http.Response, err error) {
jsonBytes, err := json.Marshal(data) jsonBytes, err := json.Marshal(data)
if err != nil { if err != nil {
return nil, err return nil, err