Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Feb 15, 2024
1 parent 85406ac commit 8f87efb
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 82 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class Main implements CommandExecutor, Listener {
<dependency>
<groupId>top.qscraft</groupId>
<artifactId>dodoopenjava</artifactId>
<version>3.2.7</version>
<version>3.2.8-SNAPSHOT</version>
</dependency>
</dependencies>
```
Expand All @@ -149,7 +149,7 @@ public class Main implements CommandExecutor, Listener {
}
dependencies {
implementation 'top.qscraft:dodoopenjava:3.2.7'
implementation 'top.qscraft:dodoopenjava:3.2.8-SNAPSHOT'
}
```
### 教程(过于古老,无参考价值,改日重写)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* 记录API调用的日志
*
* @author qscbm187531
*/
@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/**
* 机器人实例
*
* @author qscbm187531
*/
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/**
* API
*
* @author qscbm187531
*/
@Slf4j
Expand All @@ -35,7 +36,7 @@ public static synchronized Bot createBot(@NonNull String clientId, @NonNull Stri
}

public static List<Bot> getBotList() {
return BaseUtil.castList(BOT_LIST.clone(),Bot.class);
return BaseUtil.castList(BOT_LIST.clone(), Bot.class);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* api结果
*
* @author qscbm187531
*/
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ public static List<Node> getAllTextNodes(@NonNull Node node) {
return result;
}


/**
* 转Object转为List
*
* @param obj 对象
* @param clazz List包含的对象的类
* @param <T> 泛型
* @return List<T>
*/
public static <T> List<T> castList(Object obj, Class<T> clazz) {
List<T> result = new ArrayList<>();
if (obj instanceof List<?>) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,18 @@ private static String aesDecrypt(byte[] payload, byte[] secretKey, byte[] iv, Ci
* @return 字节数组
*/
private static byte[] hexToBytes(String hex) {
byte[] result = new byte[hex.length() / 2];
for (int i = 0; i < hex.length() / 2; i++) {
int hexLen = hex.length();
int arrayLen = hexLen / 2;
boolean isOdd = hexLen % 2 == 1;
byte[] result;
if (isOdd) {
arrayLen++;
result = new byte[arrayLen];
hex = "0" + hex;
} else {
result = new byte[arrayLen];
}
for (int i = 0; i < arrayLen; i++) {
int high = Integer.parseInt(hex.substring(i * 2, i * 2 + 1), 16);
int low = Integer.parseInt(hex.substring(i * 2 + 1, i * 2 + 2), 16);
result[i] = (byte) (high * 16 + low);
Expand Down

0 comments on commit 8f87efb

Please sign in to comment.