You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
530 B
24 lines
530 B
package feishu
|
|
|
|
import (
|
|
"encoding/json"
|
|
"github.com/dtapps/go-library/utils/gohttp"
|
|
"github.com/dtapps/go-library/utils/gomongo"
|
|
"net/http"
|
|
)
|
|
|
|
type App struct {
|
|
Key string
|
|
Mongo gomongo.App // 日志数据库
|
|
}
|
|
|
|
func (app *App) request(url string, params map[string]interface{}) (body []byte, err error) {
|
|
// 请求参数
|
|
paramsStr, err := json.Marshal(params)
|
|
// 请求
|
|
postJson, err := gohttp.PostJson(url, paramsStr)
|
|
// 日志
|
|
go app.mongoLog(url, params, http.MethodPost, postJson)
|
|
return postJson.Body, err
|
|
}
|