This commit is contained in:
zhaoxiaorong 2025-04-11 16:45:11 +08:00
parent dd95b8d8b1
commit 04b8e5b03b
2 changed files with 28 additions and 0 deletions

View File

@ -8,6 +8,7 @@ type Base struct {
BindIP string `yaml:"BindIP"` // 绑定IP BindIP string `yaml:"BindIP"` // 绑定IP
Addr string `yaml:"Addr"` Addr string `yaml:"Addr"`
OnMicroService bool `yaml:"OnMicroService"` OnMicroService bool `yaml:"OnMicroService"`
LoginUrl string `yaml:"LoginUrl"`
} }
type DBConf struct { type DBConf struct {

27
oplog/oplog.go Normal file
View File

@ -0,0 +1,27 @@
package oplog
import (
"bytes"
"encoding/json"
"net/http"
)
func PostLog(data any, path string) (resp *http.Response, err error) {
jsonBytes, err := json.Marshal(data)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", path, bytes.NewBuffer(jsonBytes))
if err != nil {
return nil, err
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err = client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
return
}