聊天室

1. 创建/更新聊天室

1.0.1. 地址

http://domain:18080/admin/chatroom/create

1.0.2. body

参数 类型 必需 描述
chatroomId string 否 聊天室ID,如果传空,系统会自动生成一个
title string 是 聊天室名称
desc string 否 聊天室的详情描述
portrait string 否 聊天室的头像
extra string 否 附加信息,可用来扩展字段,建议用json
state int 否 聊天室状态,请使用0

1.0.3. 响应

参数 类型 必需 描述
chatroomId string 是 聊天室ID

1.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"title\":\"火热聊天室\"}" http://localhost:18080/admin/chatroom/create

{
  "code":0,
  "msg":"success",
  "result":{
    "chatroomId":"aaaa",
  }
}

2. 获取聊天室信息

2.0.1. 地址

http://domain:18080/admin/chatroom/info

2.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID

2.0.3. 响应

参数 类型 必需 描述
chatroomId string 否 聊天室ID,如果传空,系统会自动生成一个
title string 是 聊天室名称
desc string 否 聊天室的详情描述
portrait string 否 聊天室的头像
extra string 否 附加信息,可用来扩展字段,建议用json
memberCount int 否 当前用户数
createDt long 否 创建的时间戳
updateDt long 否 更新的时间戳

2.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\"}" http://localhost:18080/admin/chatroom/info

{
  "code":0,
  "msg":"success",
  "result":{
    "chatroomId":"aaaa",
    "title":"火热聊天室",
    "memberCount":100,
    "createDt":xxxx,
    "updateDt":xxxx
  }
}

3. 销毁聊天室

3.0.1. 地址

http://domain:18080/admin/chatroom/del

3.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID

3.0.3. 响应

无

3.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\"}" http://localhost:18080/admin/chatroom/del

{
  "code":0,
  "msg":"success"
}

4. 设置/取消聊天室黑名单

仅专业版支持

4.0.1. 地址

http://domain:18080/admin/chatroom/set_black_status

4.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID
userId string 是 目标用户Id
status int 是 0,取消拉黑;1,禁言;2,禁止进入
expiredTime long 否 当拉黑或禁止进入时,过期的时间戳,0为不限时。

4.0.3. 响应

无

4.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\",\"userId\":\"usea\",\"status\":1}" http://localhost:18080/admin/chatroom/set_black_status

{
  "code":0,
  "msg":"success"
}

5. 获取聊天室黑名单

仅专业版支持

5.0.1. 地址

http://domain:18080/admin/chatroom/get_black_status

5.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID

5.0.3. 响应

参数 类型 必需 描述
infos ChatroomBlackInfo[] 是 拉黑用户信息列表

ChatroomBlackInfo

参数 类型 必需 描述
userId string 是 目标用户Id
state int 是 0,取消拉黑;1,禁言;2,禁止进入
expiredTime long 否 当拉黑或禁止进入时,过期的时间戳,0为不限时

5.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\"}" http://localhost:18080/admin/chatroom/get_black_status

{
  "code":0,
  "msg":"success",
  "result":{
    infos:[
      {"userId":"user1","state":1,expiredTime:0},
      {"userId":"user2","state":2,expiredTime:365400}
    ]
  }

}

6. 设置/取消聊天室管理员

仅专业版支持

6.0.1. 地址

http://domain:18080/admin/chatroom/set_manager

6.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID
userId string 是 目标用户Id
status int 是 0,取消管理员;1,设置管理员

6.0.3. 响应

无

6.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\",\"userId\":\"usea\",\"status\":1}" http://localhost:18080/admin/chatroom/set_manager

{
  "code":0,
  "msg":"success"
}

7. 获取聊天室黑名单

仅专业版支持

7.0.1. 地址

http://domain:18080/admin/chatroom/get_manager_list

7.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID

7.0.3. 响应

参数 类型 必需 描述
list String[] 是 管理员用户ID列表

7.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\"}" http://localhost:18080/admin/chatroom/get_manager_list

{
  "code":0,
  "msg":"success",
  "result":{
    list:["user1","user2"]
  }
}

8. 设置/取消聊天室全员禁言

仅专业版支持

8.0.1. 地址

http://domain:18080/admin/chatroom/mute_all

8.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID
status int 是 0,取消全员禁言;1,设置全员禁言

8.0.3. 响应

无

8.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\",\"status\":1}" http://localhost:18080/admin/chatroom/mute_all

{
  "code":0,
  "msg":"success"
}

9. 获取聊天室成员列表

获取指定聊天室的成员列表。

9.0.1. 地址

http://domain:18080/admin/chatroom/members

9.0.2. body

参数 类型 必需 描述
chatroomId string 是 聊天室ID

9.0.3. 响应

参数 类型 必需 描述
list string[] 是 成员用户ID列表

9.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"chatroomId\":\"aaaa\"}" http://localhost:18080/admin/chatroom/members

{
  "code":0,
  "msg":"success",
  "result":{
    "list":["user1","user2","user3"]
  }
}

10. 获取用户的聊天室

获取指定用户所在的聊天室信息。

10.0.1. 地址

http://domain:18080/admin/chatroom/user_chatroom

10.0.2. body

参数 类型 必需 描述
userId string 是 用户ID

10.0.3. 响应

参数 类型 必需 描述
chatroomId string 否 聊天室ID
title string 是 聊天室名称
desc string 否 聊天室的详情描述
portrait string 否 聊天室的头像
extra string 否 附加信息
memberCount int 否 当前用户数
createDt long 否 创建的时间戳
updateDt long 否 更新的时间戳

10.0.4. 示例

curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"userId\":\"user1\"}" http://localhost:18080/admin/chatroom/user_chatroom

{
  "code":0,
  "msg":"success",
  "result":{
    "chatroomId":"aaaa",
    "title":"火热聊天室",
    "memberCount":100
  }
}
2018 © wildfirechat.net 京ICP备18060403号-1 all right reserved,powered by Gitbook该文件修订时间: 2026-01-30 17:10:18

results matching ""

    No results matching ""