contact.go 522 B

123456789101112131415161718
  1. package hook
  2. import "fmt"
  3. // 获取好友和群信息
  4. func (h *Hook) GetFriendAndChatRoomList(typeStr string) (result GetFriendAndChatRoomListReap, err error) {
  5. resp, err := h.Client.R().SetBody(&GetFriendAndChatRoomListReq{
  6. Type: typeStr,
  7. }).SetSuccessResult(&result).Post("http://" + h.ServerIp + ":" + h.WxPort + "/GetFriendAndChatRoomList")
  8. if err != nil {
  9. return
  10. }
  11. if !resp.IsSuccessState() {
  12. err = fmt.Errorf("GetFriendAndChatRoomList failed with status code %d", resp.StatusCode)
  13. return
  14. }
  15. return
  16. }