소스 검색

Fix #389, directory typo

ryoii 4 년 전
부모
커밋
ce113182fa

+ 2 - 1
docs/adapter/HttpAdapter.md

@@ -594,7 +594,8 @@ adapterSettings:
     "permission":"OWNER"
   },
   "isFile":true,
-  "isDictionary":false
+  "isDictionary":false,
+  "isDirectory":false
 }
 ```
 

+ 12 - 7
docs/api/API.md

@@ -521,7 +521,8 @@
         "permission":"OWNER"
       },
       "isFile":true,
-      "isDictionary":false
+      "isDictionary":false,
+      "isDirectory":false
     }
   ]
 }
@@ -536,7 +537,8 @@
 | data.contact | Object | 群信息或好友信息                  |
 | data.contact | Object | 群信息或好友信息                  |
 | data.isFile  | Boolean | 是否文件                         |
-| data.isDictionary | Boolean | 是否文件夹                  |
+| data.isDictionary | Boolean | ~~是否文件夹~~(弃用)                  |
+| data.isDirectory | Boolean | 是否文件夹                  |
 
 ### 获取文件信息
 
@@ -577,7 +579,8 @@
       "permission":"OWNER"
     },
     "isFile":true,
-    "isDictionary":false
+    "isDictionary":false,
+    "isDirectory":false
   }
 }
 ```
@@ -591,7 +594,8 @@
 | data.contact | Object | 群信息或好友信息                  |
 | data.contact | Object | 群信息或好友信息                  |
 | data.isFile  | Boolean | 是否文件                         |
-| data.isDictionary | Boolean | 是否文件夹                  |
+| data.isDictionary | Boolean | ~~是否文件夹~~(弃用)                  |
+| data.isDirectory | Boolean | 是否文件夹                  |
 
 ### 创建文件夹
 
@@ -604,7 +608,7 @@
   "target":987654321,
   "group":null,
   "qq":null,
-  "dictionaryName": "newDictionaryName"
+  "directoryName": "newDirectoryName"
 }
 ```
 
@@ -615,7 +619,7 @@
 | target       | Long   | true  | 987654321   | 群号或好友QQ号                   |
 | group        | Long   | true  | 987654321   | 群号                            |
 | qq           | Long   | true  | 987654321   | 好友QQ号                        |
-| dictionaryName | String | false  | ""       | 新建文件夹名                     |
+| directoryName | String | false  | ""       | 新建文件夹名                     |
 
 #### 响应:
 
@@ -634,7 +638,8 @@
       "permission":"OWNER"
     },
     "isFile":false,
-    "isDictionary":true
+    "isDictionary":true,
+    "isDirectory":true
   }
 }
 ```

+ 1 - 1
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/adapter/internal/action/file.kt

@@ -27,7 +27,7 @@ internal suspend fun onGetFileInfo(dto: FileTargetDTO): ElementResult {
 
 internal suspend fun onMkDir(dto: MkDirDTO): ElementResult {
     val root = dto.session.bot.getFileSupported(dto).filesRoot
-    val remoteFile = root.resolve(dto.dictionaryName).also {
+    val remoteFile = root.resolve(dto.directoryName).also {
         it.mkdir()
     }
     return ElementResult(

+ 3 - 1
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/adapter/internal/dto/file.kt

@@ -12,7 +12,8 @@ internal data class RemoteFileDTO(
     val parent: RemoteFileDTO? = null,
     val contact: GroupDTO,
     val isFile: Boolean,
-    val isDictionary: Boolean
+    val isDictionary: Boolean,
+    val isDirectory: Boolean,
 ) : DTO {
     constructor(remoteFile: RemoteFile, isFile: Boolean) : this(
         remoteFile.name,
@@ -25,5 +26,6 @@ internal data class RemoteFileDTO(
         },
         isFile,
         !isFile,
+        !isFile,
     )
 }

+ 1 - 1
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/adapter/internal/dto/parameter/file.kt

@@ -25,7 +25,7 @@ internal data class MkDirDTO(
     override val target: Long? = null,
     override val group: Long? = null,
     override val qq: Long? = null,
-    val dictionaryName: String,
+    val directoryName: String,
 ) : AbstractFileTargetDTO()
 
 @Serializable