Browse Source

Fix userProfile docs

ryoii 4 years ago
parent
commit
c54c7b95d8

+ 1 - 0
docs/adapter/HttpAdapter.md

@@ -56,6 +56,7 @@ adapterSettings:
   + [获取Bot资料](#获取Bot资料)
   + [获取好友资料](#获取好友资料)
   + [获取群成员资料](#获取群成员资料)
+  + [获取QQ用户资料](#获取QQ用户资料)
 + **[消息发送与撤回](#消息发送与撤回)**
   + [发送好友消息](#发送好友消息)
   + [发送群消息](#发送群消息)

+ 11 - 0
docs/adapter/ReverseWebsocketAdapter.md

@@ -75,6 +75,7 @@ adapterSettings:
   + [获取Bot资料](#获取Bot资料)
   + [获取好友资料](#获取好友资料)
   + [获取群成员资料](#获取群成员资料)
+  + [获取QQ用户资料](#获取QQ用户资料)
 + **[消息发送与撤回](#消息发送与撤回)**
   + [发送好友消息](#发送好友消息)
   + [发送群消息](#发送群消息)
@@ -280,6 +281,16 @@ adapterSettings:
 
 通用接口定义: [获取群成员资料](../api/API.md#获取群成员资料)
 
+### 获取QQ用户资料
+
+此接口获取获取QQ用户资料
+
+```
+命令字: userProfile
+```
+
+通用接口定义: [获取QQ用户资料](../api/API.md#获取QQ用户资料)
+
 ## 消息发送与撤回
 
 ### 发送好友消息

+ 11 - 0
docs/adapter/WebsocketAdapter.md

@@ -49,6 +49,7 @@ adapterSettings:
   + [获取Bot资料](#获取Bot资料)
   + [获取好友资料](#获取好友资料)
   + [获取群成员资料](#获取群成员资料)
+  + [获取QQ用户资料](#获取QQ用户资料)
 + **[消息发送与撤回](#消息发送与撤回)**
   + [发送好友消息](#发送好友消息)
   + [发送群消息](#发送群消息)
@@ -236,6 +237,16 @@ adapterSettings:
 
 通用接口定义: [获取群成员资料](../api/API.md#获取群成员资料)
 
+### 获取QQ用户资料
+
+此接口获取获取QQ用户资料
+
+```
+命令字: userProfile
+```
+
+通用接口定义: [获取QQ用户资料](../api/API.md#获取QQ用户资料)
+
 ## 消息发送与撤回
 
 ### 发送好友消息

+ 4 - 4
docs/api/API.md

@@ -329,10 +329,10 @@
 
 #### 请求:
 
-| 名字         | 可选  | 举例           | 说明          |
-|------------| ----- | -------------- |-------------|
-| sessionKey | true  | YourSessionKey | 你的session key |
-| userId     | false | 987654321      | 要查询的QQ号码    |
+| 名字           | 可选      | 举例              | 说明              |
+|--------------|---------|-----------------|-----------------|
+| sessionKey   | true    | YourSessionKey  | 你的session key   |
+| target       | false   | 987654321       | 要查询的QQ号码        |
 
 #### 响应:
 

+ 2 - 3
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/adapter/internal/action/infomation.kt

@@ -16,7 +16,6 @@ import net.mamoe.mirai.api.http.adapter.internal.dto.parameter.GroupList
 import net.mamoe.mirai.api.http.adapter.internal.dto.parameter.LongTargetDTO
 import net.mamoe.mirai.api.http.adapter.internal.dto.parameter.MemberList
 import net.mamoe.mirai.api.http.adapter.internal.dto.parameter.MemberTargetDTO
-import net.mamoe.mirai.api.http.adapter.internal.dto.parameter.UserTargetDTO
 
 /**
  * 查询好友列表
@@ -64,5 +63,5 @@ internal suspend fun onGetMemberProfile(dto: MemberTargetDTO): ProfileDTO =
 /**
  * 查询QQ账号信息
  */
-internal suspend fun onGetUserProfile(dto: UserTargetDTO): ProfileDTO =
-    ProfileDTO(Mirai.queryProfile(dto.session.bot, dto.userId))
+internal suspend fun onGetUserProfile(dto: LongTargetDTO): ProfileDTO =
+    ProfileDTO(Mirai.queryProfile(dto.session.bot, dto.target))

+ 0 - 5
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/adapter/internal/dto/parameter/common.kt

@@ -65,8 +65,3 @@ internal class RemoteFileList(
 internal class AnnouncementList(
     val data: List<AnnouncementDTO>
 ) : RestfulResult()
-// Common user target
-@Serializable
-internal data class UserTargetDTO(
-    val userId: Long
-) : AuthedDTO()