From 5c8d80b56d525b43850c34273e44374be498a6fa Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 4 Feb 2024 09:31:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A2=A7=E6=B5=B7=E5=89=A7=E5=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playlet_bihai/api.go | 20 ++++++++++++++++++++ playlet_bihai/playlet_bihai.go | 25 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 playlet_bihai/api.go create mode 100644 playlet_bihai/playlet_bihai.go diff --git a/playlet_bihai/api.go b/playlet_bihai/api.go new file mode 100644 index 0000000..6394605 --- /dev/null +++ b/playlet_bihai/api.go @@ -0,0 +1,20 @@ +package playlet_bihai + +import ( + zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" + "fmt" +) + +func SendPost(method string, token string, param map[string]string) (string, error) { + url := "https://distributionapi.qinronmedia.com/" + method + header := map[string]string{} + if token != "" { + header = map[string]string{ + "Authorization": "Bearer " + token, + } + } + get, err := zhios_third_party_utils.CurlPost(url, zhios_third_party_utils.SerializeStr(param), header) + fmt.Println(string(get)) + fmt.Println(err) + return string(get), err +} diff --git a/playlet_bihai/playlet_bihai.go b/playlet_bihai/playlet_bihai.go new file mode 100644 index 0000000..e95b7a6 --- /dev/null +++ b/playlet_bihai/playlet_bihai.go @@ -0,0 +1,25 @@ +package playlet_bihai + +//https://console-docs.apipost.cn/preview/6df4dac69ed4fe2e/e84becfee59b6d83?target_id=55e570ad-d893-4c3d-b469-91fe0f1eea30 +func Login(args map[string]string) (string, error) { + + post, err := SendPost("api/v1/user/login/key", "", args) + return post, err +} + +func VideoList(token string, args map[string]string) (string, error) { + post, err := SendPost("api/v1/open/video/list", token, args) + return post, err +} +func CreateLink(token string, args map[string]string) (string, error) { + post, err := SendPost("api/v1/open/create/link", token, args) + return post, err +} +func OrderList(token string, args map[string]string) (string, error) { + post, err := SendPost("api/v2/open/order/list", token, args) + return post, err +} +func RefundOrderList(token string, args map[string]string) (string, error) { + post, err := SendPost("api/v1/open/refund/order/list", token, args) + return post, err +}