niki/vendor/github.com/kavenegar/kavenegar-go/message_selectOutbox.go

33 lines
708 B
Go
Raw Normal View History

2024-02-18 10:42:21 +00:00
package kavenegar
import (
"net/url"
"time"
)
2024-05-14 13:07:09 +00:00
//SelectOutbox ...
2024-02-18 10:42:21 +00:00
func (message *MessageService) SelectOutbox(startdate time.Time, endate time.Time, sender string) ([]Message, error) {
v := url.Values{}
if !startdate.IsZero() {
v.Set("startdate", ToUnix(startdate))
}
if !endate.IsZero() {
v.Set("endate", ToUnix(endate))
}
if v.Get("sender") != "" {
v.Set("sender", v.Get("sender"))
}
return message.CreateSelectOutbox(v)
}
2024-05-14 13:07:09 +00:00
//CreateSelectOutbox ...
2024-02-18 10:42:21 +00:00
func (message *MessageService) CreateSelectOutbox(v url.Values) ([]Message, error) {
u := message.client.EndPoint("sms", "selectoutbox")
m := new(MessageResult)
err := message.client.Execute(u.String(), v, m)
return m.Entries, err
}