chatroom.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package hook
  2. import "fmt"
  3. // 网络获取群成员wxid
  4. func (h *Hook) BatchGetChatRoomMemberWxid(gid string) (result GetBatchGetChatRoomMemberWxidReap, err error) {
  5. resp, err := h.Client.R().SetBody(&GetBatchGetChatRoomMemberWxidReq{
  6. Gid: gid,
  7. }).SetSuccessResult(&result).Post("http://" + h.ServerIp + ":" + h.WxPort + "/BatchGetChatRoomMemberWxid")
  8. if err != nil {
  9. return
  10. }
  11. if !resp.IsSuccessState() {
  12. err = fmt.Errorf("BatchGetChatRoomMemberWxid failed with status code %d", resp.StatusCode)
  13. return
  14. }
  15. return
  16. }
  17. // 批量获取群成员邀请信息
  18. func (h *Hook) GetChatrooMmemberDetail(gid string) (result GetChatrooMmemberDetailReap, err error) {
  19. resp, err := h.Client.R().SetBody(&GetChatrooMmemberDetailReq{
  20. Gid: gid,
  21. }).SetSuccessResult(&result).Post("http://" + h.ServerIp + ":" + h.WxPort + "/GetChatrooMmemberDetail")
  22. if err != nil {
  23. return
  24. }
  25. if !resp.IsSuccessState() {
  26. err = fmt.Errorf("GetChatrooMmemberDetail failed with status code %d", resp.StatusCode)
  27. return
  28. }
  29. return
  30. }
  31. // 网络获取群成员详细信息
  32. func (h *Hook) GetChatroomMemberDetailInfo(gid string, wxid string) (result GetChatroomMemberDetailInfoReap, err error) {
  33. resp, err := h.Client.R().SetBody(&GetChatroomMemberDetailInfoReq{
  34. Gid: gid,
  35. Wxid: wxid,
  36. }).SetSuccessResult(&result).Post("http://" + h.ServerIp + ":" + h.WxPort + "/GetChatroomMemberDetailInfo")
  37. if err != nil {
  38. return
  39. }
  40. if !resp.IsSuccessState() {
  41. err = fmt.Errorf("GetChatroomMemberDetailInfo failed with status code %d", resp.StatusCode)
  42. return
  43. }
  44. return
  45. }