parent
2359d7ab37
commit
4fc00109ef
@ -1,31 +0,0 @@
|
|||||||
package push
|
|
||||||
|
|
||||||
import (
|
|
||||||
"Open_IM/internal/push/sdk/tpns-server-sdk-go/go/auth"
|
|
||||||
"Open_IM/pkg/common/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
var badgeType = -2
|
|
||||||
var iosAcceptId = auth.Auther{AccessID: config.Config.Push.Tpns.Ios.AccessID, SecretKey: config.Config.Push.Tpns.Ios.SecretKey}
|
|
||||||
|
|
||||||
func IOSAccountListPush(accounts []string, title, content, jsonCustomContent string) {
|
|
||||||
var iosMessage = tpns.Message{
|
|
||||||
Title: title,
|
|
||||||
Content: content,
|
|
||||||
IOS: &tpns.IOSParams{
|
|
||||||
Aps: &tpns.Aps{
|
|
||||||
BadgeType: &badgeType,
|
|
||||||
Sound: "default",
|
|
||||||
Category: "INVITE_CATEGORY",
|
|
||||||
},
|
|
||||||
CustomContent: jsonCustomContent,
|
|
||||||
//CustomContent: `"{"key\":\"value\"}"`,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
pushReq, reqBody, err := req.NewListAccountPush(accounts, iosMessage)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
iosAcceptId.Auth(pushReq, auth.UseSignAuthored, iosAcceptId, reqBody)
|
|
||||||
common.PushAndGetResult(pushReq)
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package discoveryregistry
|
|
||||||
|
|
||||||
import "google.golang.org/grpc"
|
|
||||||
|
|
||||||
type Robin struct {
|
|
||||||
next int
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Robin) Robin(slice []*grpc.ClientConn) int {
|
|
||||||
index := r.next
|
|
||||||
r.next += 1
|
|
||||||
if r.next > len(slice)-1 {
|
|
||||||
r.next = 0
|
|
||||||
}
|
|
||||||
return index
|
|
||||||
}
|
|
Loading…
Reference in new issue