| | |
| | | |
| | | return vo.StatusSuccess |
| | | } |
| | | func UpdateSubscribe(url string, msg []byte) int { |
| | | rsp, err := util.HttpPut(url, headers, msg) |
| | | if err != nil { |
| | | logger.Warn("Put subscribe failed, %s", err.Error()) |
| | | return vo.StatusOtherError |
| | | } |
| | | |
| | | var stat vo.ResponseStatusList |
| | | err = json.Unmarshal(rsp, &stat) |
| | | if err != nil { |
| | | logger.Warn("Put subscribe response unmarshal failed, %s", err.Error()) |
| | | logger.Warn("response, %s", string(rsp)) |
| | | return vo.StatusOtherError |
| | | } |
| | | |
| | | logger.Debug("Post notification success.") |
| | | |
| | | return vo.StatusSuccess |
| | | } |