Compare commits

..

2 Commits

Author SHA1 Message Date
zhaoxiaorong
d691648916 fix 2025-04-11 17:53:50 +08:00
zhaoxiaorong
8060cdb508 fix 2025-04-11 17:50:06 +08:00
2 changed files with 5 additions and 2 deletions

View File

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

View File

@@ -1,5 +1,8 @@
package oplog
type LogRequest struct {
Data []*LogItem `json:"data"`
}
type LogItem struct {
OpID uint `json:"op_id"`
OpName string `json:"op_name"`