count
This commit is contained in:
parent
e02ab6405d
commit
2342ce66b1
|
|
@ -3,8 +3,9 @@ package unify
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.u8t.cn/open/gosdk/util"
|
||||
"net/url"
|
||||
|
||||
"git.u8t.cn/open/gosdk/util"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
|
|
@ -25,13 +26,15 @@ func NewMessage(addreess string, token string, sender string) *Message {
|
|||
}
|
||||
|
||||
func (m *Message) Send(args ...string) error {
|
||||
var receiver, content, fingerprint string
|
||||
var receiver, content, fingerprint, count string
|
||||
if len(args) == 2 {
|
||||
receiver, content = args[0], args[1]
|
||||
} else if len(args) > 2 {
|
||||
} else if len(args) == 3 {
|
||||
receiver, content, fingerprint = args[0], args[1], args[2]
|
||||
} else if len(args) > 3 {
|
||||
receiver, content, fingerprint, count = args[0], args[1], args[2], args[3]
|
||||
}
|
||||
reqUrl := fmt.Sprintf("%s/admin/message/send?sender=%s&receiver=%s&fingerprint=%s&content=%s", m.address, m.sender, receiver, fingerprint, url.QueryEscape(content))
|
||||
reqUrl := fmt.Sprintf("%s/admin/message/send?sender=%s&receiver=%s&fingerprint=%s&count=%s&content=%s", m.address, m.sender, receiver, fingerprint, count, url.QueryEscape(content))
|
||||
body, err := util.HttpGet(reqUrl, map[string]string{
|
||||
"x-token": m.token,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue