1
This commit is contained in:
@@ -96,12 +96,12 @@ func TestGetUserByMobile(t *testing.T) {
|
|||||||
func TestCreateSession(t *testing.T) {
|
func TestCreateSession(t *testing.T) {
|
||||||
api = New("ww9a156bfa070e1857", "JQsEmSTltHhNgdPIT320YJFphiYmRs-YZa-rCBwplss") // 小程序
|
api = New("ww9a156bfa070e1857", "JQsEmSTltHhNgdPIT320YJFphiYmRs-YZa-rCBwplss") // 小程序
|
||||||
err := api.CreateAppChat(&CreateAppChatParamReq{
|
err := api.CreateAppChat(&CreateAppChatParamReq{
|
||||||
UserList: []string{"jx2022524_668511", "LiuLei"},
|
UserList: []string{"WangXiao", "LiuLei"},
|
||||||
Name: "test1liulei",
|
Name: "刘磊的企业微信群1",
|
||||||
Owner: "LiuLei",
|
Owner: "LiuLei",
|
||||||
ChatId: "11112",
|
ChatId: "18981810341",
|
||||||
})
|
})
|
||||||
fmt.Println(err)
|
fmt.Println("err======", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test1111(t *testing.T) {
|
func Test1111(t *testing.T) {
|
||||||
|
|||||||
@@ -33,16 +33,6 @@ func (a *API) GetToken() (token string, err error) {
|
|||||||
return token, err
|
return token, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type GroupchatListResult struct {
|
|
||||||
Errcode int `json:"errcode"`
|
|
||||||
Errmsg string `json:"errmsg"`
|
|
||||||
GroupChatList []struct {
|
|
||||||
ChatID string `json:"chat_id"`
|
|
||||||
Status int `json:"status"`
|
|
||||||
} `json:"group_chat_list"`
|
|
||||||
NextCursor string `json:"next_cursor"`
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取客户群列表
|
//获取客户群列表
|
||||||
func (a *API) GroupchatList(cursor string, limit int) (groupchatListResult *GroupchatListResult, err error) {
|
func (a *API) GroupchatList(cursor string, limit int) (groupchatListResult *GroupchatListResult, err error) {
|
||||||
params := map[string]interface{}{
|
params := map[string]interface{}{
|
||||||
@@ -57,30 +47,7 @@ func (a *API) GroupchatList(cursor string, limit int) (groupchatListResult *Grou
|
|||||||
return groupchatListResult, err
|
return groupchatListResult, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type GroupchatResutl struct {
|
// 获取客户群详情
|
||||||
Errcode int `json:"errcode"`
|
|
||||||
Errmsg string `json:"errmsg"`
|
|
||||||
GroupChat struct {
|
|
||||||
ChatID string `json:"chat_id"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
Owner string `json:"owner"`
|
|
||||||
CreateTime int `json:"create_time"`
|
|
||||||
MemberList []struct {
|
|
||||||
Userid string `json:"userid"`
|
|
||||||
Type int `json:"type"`
|
|
||||||
JoinTime int `json:"join_time"`
|
|
||||||
JoinScene int `json:"join_scene"`
|
|
||||||
UnionID string `json:"unionid"`
|
|
||||||
Invitor struct {
|
|
||||||
Userid string `json:"userid"`
|
|
||||||
} `json:"invitor,omitempty"`
|
|
||||||
State string `json:"state,omitempty"`
|
|
||||||
} `json:"member_list"`
|
|
||||||
AdminList []interface{} `json:"admin_list"`
|
|
||||||
} `json:"group_chat"`
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取客户群详情
|
|
||||||
func (a *API) Groupchat(chat_id string) (groupchatListResult *GroupchatResutl, err error) {
|
func (a *API) Groupchat(chat_id string) (groupchatListResult *GroupchatResutl, err error) {
|
||||||
params := map[string]interface{}{
|
params := map[string]interface{}{
|
||||||
"chat_id": chat_id,
|
"chat_id": chat_id,
|
||||||
|
|||||||
36
platformapi/qywxapi/cgibin_model.go
Normal file
36
platformapi/qywxapi/cgibin_model.go
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package qywxapi
|
||||||
|
|
||||||
|
// 获取客户群详情
|
||||||
|
type GroupchatResutl struct {
|
||||||
|
Errcode int `json:"errcode"`
|
||||||
|
Errmsg string `json:"errmsg"`
|
||||||
|
GroupChat struct {
|
||||||
|
ChatID string `json:"chat_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Owner string `json:"owner"`
|
||||||
|
CreateTime int `json:"create_time"`
|
||||||
|
MemberList []struct {
|
||||||
|
Userid string `json:"userid"`
|
||||||
|
Type int `json:"type"`
|
||||||
|
JoinTime int `json:"join_time"`
|
||||||
|
JoinScene int `json:"join_scene"`
|
||||||
|
UnionID string `json:"unionid"`
|
||||||
|
Invitor struct {
|
||||||
|
Userid string `json:"userid"`
|
||||||
|
} `json:"invitor,omitempty"`
|
||||||
|
State string `json:"state,omitempty"`
|
||||||
|
} `json:"member_list"`
|
||||||
|
AdminList []interface{} `json:"admin_list"`
|
||||||
|
} `json:"group_chat"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取客户群列表
|
||||||
|
type GroupchatListResult struct {
|
||||||
|
Errcode int `json:"errcode"`
|
||||||
|
Errmsg string `json:"errmsg"`
|
||||||
|
GroupChatList []struct {
|
||||||
|
ChatID string `json:"chat_id"`
|
||||||
|
Status int `json:"status"`
|
||||||
|
} `json:"group_chat_list"`
|
||||||
|
NextCursor string `json:"next_cursor"`
|
||||||
|
}
|
||||||
6
platformapi/qywxapi/create_group_chat.go
Normal file
6
platformapi/qywxapi/create_group_chat.go
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package qywxapi
|
||||||
|
|
||||||
|
// CreateGroupChat 创建群聊会话
|
||||||
|
func (a *API) CreateGroupChat() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package qywxapi
|
package qywxapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi"
|
"git.rosy.net.cn/baseapi"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -17,3 +20,7 @@ func init() {
|
|||||||
|
|
||||||
api = New("ww9a156bfa070e1857", "q6H6WFV-c7gyyfBaxLxilIzeJv_mGk1CXtPqUR5qm4E", "cfHqzPxhClCnneMfhFtJVnY1ySVNs1B1Z4QZa130j5qFcLx1BUQJuEFuUdnKNdWqrWZaN3ElqKugY5kCxG3MONXtvzvAfzcJVH10RbNNq8sGCbZEaB7oMld-mrl2VZH4pqBlbWGfGfy7dj57FE0Uf900511PSM4X6QwmdKk9zHYCZLntR9ZoLi21BiW7zj_op50weRc_PGP98ciuCKM6lA")
|
api = New("ww9a156bfa070e1857", "q6H6WFV-c7gyyfBaxLxilIzeJv_mGk1CXtPqUR5qm4E", "cfHqzPxhClCnneMfhFtJVnY1ySVNs1B1Z4QZa130j5qFcLx1BUQJuEFuUdnKNdWqrWZaN3ElqKugY5kCxG3MONXtvzvAfzcJVH10RbNNq8sGCbZEaB7oMld-mrl2VZH4pqBlbWGfGfy7dj57FE0Uf900511PSM4X6QwmdKk9zHYCZLntR9ZoLi21BiW7zj_op50weRc_PGP98ciuCKM6lA")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestYear(t *testing.T) {
|
||||||
|
fmt.Println(time.Now().Year())
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user