From 8c84726593e184fd246d0f3ae7c746117855cf77 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期五, 17 五月 2024 02:59:03 +0800
Subject: [PATCH] fix build bug
---
client/notify.go | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/client/notify.go b/client/notify.go
index 9532e84..ba3ad7e 100644
--- a/client/notify.go
+++ b/client/notify.go
@@ -29,3 +29,27 @@
return vo.StatusSuccess
}
+
+func Subscribe(url string, msg []byte) int {
+ //if clientStatus != vo.StatusSuccess {
+ // return clientStatus
+ //}
+
+ rsp, err := util.HttpPost(url, headers, msg)
+ if err != nil {
+ logger.Warn("Post subscribe failed, %s", err.Error())
+ return vo.StatusOtherError
+ }
+
+ var stat vo.ResponseStatusList
+ err = json.Unmarshal(rsp, &stat)
+ if err != nil {
+ logger.Warn("Post subscribe response unmarshal failed, %s", err.Error())
+ logger.Warn("response, %s", string(rsp))
+ return vo.StatusOtherError
+ }
+
+ logger.Debug("Post notification success.")
+
+ return vo.StatusSuccess
+}
--
Gitblit v1.8.0