Class: KHL::HTTP::UserChat

Inherits:
Base
  • Object
show all
Defined in:
lib/khl/http/user_chat.rb

Overview

私信聊天会话相关接口 developer.kaiheila.cn/doc/http/user-chat

Constant Summary

Constants inherited from Base

Base::API_VERSION, Base::BASE_URL, Base::END_POINT

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#get, #initialize, #post, #post_file

Constructor Details

This class inherits a constructor from KHL::HTTP::Base

Instance Method Details

#create(target_id) ⇒ KHL::HTTP::Response

创建私信聊天会话

Parameters:

  • target_id (String)

    用户 ID

Returns:



29
30
31
# File 'lib/khl/http/user_chat.rb', line 29

def create(target_id)
  post(target_id: target_id)
end

#delete(target_id) ⇒ KHL::HTTP::Response

Note:

只能删除自己的消息

删除私信聊天会话

Parameters:

  • target_id (String)

    用户 ID

Returns:



37
38
39
# File 'lib/khl/http/user_chat.rb', line 37

def delete(target_id)
  post(target_id: target_id)
end

#list(options = {}) ⇒ KHL::HTTP::Response

获取私信聊天会话列表

Parameters:

  • options (Hash) (defaults to: {})

    可选参数

Options Hash (options):

  • :page (Integer)

    页数

  • :page_size (Integer)

    每页数据数量

Returns:



15
16
17
# File 'lib/khl/http/user_chat.rb', line 15

def list(options = {})
  get(options)
end

#view(chat_code) ⇒ KHL::HTTP::Response

获取私信聊天会话详情

Parameters:

  • chat_code (String)

    私聊会话 Code

Returns:



22
23
24
# File 'lib/khl/http/user_chat.rb', line 22

def view(chat_code)
  get(chat_code: chat_code)
end