2020-03-24 20:19:47 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
txim "github.com/xucx/txim/api"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
txim.Init(1, "xxx", "xxx")
|
|
|
|
|
|
|
|
//生成签名
|
|
|
|
sig := txim.UserSig("xxx", 300)
|
|
|
|
fmt.Println("签名:", sig)
|
|
|
|
|
|
|
|
//创建房间
|
|
|
|
ans, err := txim.GroupCreate(&txim.GroupCreateReq{
|
|
|
|
OwnerAccount: "administrator",
|
|
|
|
Type: "ChatRoom",
|
|
|
|
Name: "测试聊天室",
|
|
|
|
ApplyJoinOption: "FreeAccess",
|
|
|
|
})
|
2020-03-24 20:38:26 +08:00
|
|
|
fmt.Printf("创建房间结果:%v,%+v\n", err, ans)
|
2020-03-24 20:19:47 +08:00
|
|
|
|
|
|
|
}
|