mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Compare commits
5 Commits
1.11.6-Rel
...
1.11.8-Rel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
089d8d6ed8 | ||
|
|
4be74c45ff | ||
|
|
db4d382e34 | ||
|
|
2590200205 | ||
|
|
4aefde8a0c |
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.11.5-Release</version>
|
<version>1.11.7-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>API</artifactId>
|
<artifactId>API</artifactId>
|
||||||
|
|||||||
@@ -39,11 +39,16 @@ public class TikTokGiftComboEvent extends TikTokGiftEvent {
|
|||||||
this.comboState = comboState;
|
this.comboState = comboState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TikTokGiftComboEvent(Gift gift, User host, User user, int combo, GiftComboStateType comboState) {
|
||||||
|
super(gift, user, host, combo);
|
||||||
|
this.comboState = comboState;
|
||||||
|
}
|
||||||
|
|
||||||
public static TikTokGiftComboEvent of(Gift gift, int combo, GiftComboStateType comboState) {
|
public static TikTokGiftComboEvent of(Gift gift, int combo, GiftComboStateType comboState) {
|
||||||
return new TikTokGiftComboEvent(
|
return new TikTokGiftComboEvent(gift, new User(0L, "Test", new Picture("")), WebcastGiftMessage.newBuilder().setComboCount(combo).build(), comboState);
|
||||||
gift,
|
}
|
||||||
new User(0L, "Test", new Picture("")),
|
|
||||||
WebcastGiftMessage.newBuilder().setComboCount(combo).build(),
|
public static TikTokGiftComboEvent of(Gift gift, User host, User user, int combo, GiftComboStateType comboState) {
|
||||||
comboState);
|
return new TikTokGiftComboEvent(gift, host, user, combo, comboState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,17 +49,25 @@ public class TikTokGiftEvent extends TikTokHeaderEvent {
|
|||||||
}
|
}
|
||||||
combo = msg.getComboCount();
|
combo = msg.getComboCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public TikTokGiftEvent(Gift gift) {
|
public TikTokGiftEvent(Gift gift, User user, User toUser, int combo) {
|
||||||
this.gift = gift;
|
this.gift = gift;
|
||||||
user = new User(0L, "sender", new Picture(""));
|
this.user = user;
|
||||||
toUser = new User(0L, "receiver", new Picture(""));
|
this.toUser = toUser;
|
||||||
combo = 1;
|
this.combo = combo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static TikTokGiftEvent of(Gift gift) {
|
public static TikTokGiftEvent of(Gift gift) {
|
||||||
return new TikTokGiftEvent(gift);
|
return new TikTokGiftEvent(
|
||||||
|
gift,
|
||||||
|
new User(0L, "sender", new Picture("")),
|
||||||
|
new User(0L, "reviever", new Picture("")),
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TikTokGiftEvent of(Gift gift, User user, User toUser) {
|
||||||
|
return new TikTokGiftEvent(gift, user, toUser, 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TikTokGiftEvent of(String name, int id, int diamonds) {
|
public static TikTokGiftEvent of(String name, int id, int diamonds) {
|
||||||
|
|||||||
@@ -44,10 +44,20 @@ public class TikTokFollowEvent extends TikTokHeaderEvent {
|
|||||||
|
|
||||||
public static TikTokFollowEvent of(String userName) {
|
public static TikTokFollowEvent of(String userName) {
|
||||||
return new TikTokFollowEvent(WebcastSocialMessage.newBuilder()
|
return new TikTokFollowEvent(WebcastSocialMessage.newBuilder()
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
.setUsername(userName)
|
.setUsername(userName)
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
.build())
|
.build())
|
||||||
.build());
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TikTokFollowEvent of(User user) {
|
||||||
|
return new TikTokFollowEvent(WebcastSocialMessage.newBuilder()
|
||||||
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setUsername(user.getName())
|
||||||
|
.setNickname(user.getProfileName() != null ? user.getProfileName() : user.getName())
|
||||||
|
.setId(user.getId())
|
||||||
|
.build())
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,13 +48,22 @@ public class TikTokJoinEvent extends TikTokHeaderEvent {
|
|||||||
totalUsers = msg.getMemberCount();
|
totalUsers = msg.getMemberCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TikTokJoinEvent of(String userName)
|
public static TikTokJoinEvent of(String userName) {
|
||||||
{
|
|
||||||
return new TikTokJoinEvent(WebcastMemberMessage.newBuilder()
|
return new TikTokJoinEvent(WebcastMemberMessage.newBuilder()
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
.setUsername(userName)
|
.setUsername(userName)
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
.build())
|
.build())
|
||||||
.build());
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TikTokJoinEvent of(User user) {
|
||||||
|
return new TikTokJoinEvent(WebcastMemberMessage.newBuilder()
|
||||||
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setUsername(user.getName())
|
||||||
|
.setNickname(user.getProfileName())
|
||||||
|
.setId(user.getId())
|
||||||
|
.build())
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,15 +56,25 @@ public class TikTokLikeEvent extends TikTokHeaderEvent
|
|||||||
totalLikes = msg.getTotal();
|
totalLikes = msg.getTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TikTokLikeEvent of(String userName, int likes)
|
public static TikTokLikeEvent of(String userName, int likes) {
|
||||||
{
|
|
||||||
return new TikTokLikeEvent(WebcastLikeMessage.newBuilder()
|
return new TikTokLikeEvent(WebcastLikeMessage.newBuilder()
|
||||||
.setCount(likes)
|
.setCount(likes)
|
||||||
.setTotal(likes)
|
.setTotal(likes)
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
.setUsername(userName)
|
.setUsername(userName)
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
.build())
|
.build())
|
||||||
.build());
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TikTokLikeEvent of(User user, int likes) {
|
||||||
|
return new TikTokLikeEvent(WebcastLikeMessage.newBuilder()
|
||||||
|
.setCount(likes)
|
||||||
|
.setTotal(likes)
|
||||||
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setUsername(user.getName())
|
||||||
|
.setNickname(user.getProfileName())
|
||||||
|
.build())
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,10 +49,19 @@ public class TikTokShareEvent extends TikTokHeaderEvent {
|
|||||||
|
|
||||||
public static TikTokShareEvent of(String userName, int shaders) {
|
public static TikTokShareEvent of(String userName, int shaders) {
|
||||||
return new TikTokShareEvent(WebcastSocialMessage.newBuilder()
|
return new TikTokShareEvent(WebcastSocialMessage.newBuilder()
|
||||||
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
.setUsername(userName)
|
.setUsername(userName)
|
||||||
.setNickname(userName)
|
.setNickname(userName)
|
||||||
.build())
|
.build())
|
||||||
.build(), shaders);
|
.build(), shaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TikTokShareEvent of(User user, int shaders) {
|
||||||
|
return new TikTokShareEvent(WebcastSocialMessage.newBuilder()
|
||||||
|
.setUser(io.github.jwdeveloper.tiktok.messages.data.User.newBuilder()
|
||||||
|
.setUsername(user.getName())
|
||||||
|
.setNickname(user.getProfileName())
|
||||||
|
.build())
|
||||||
|
.build(), shaders);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.11.5-Release</version>
|
<version>1.11.7-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import io.github.jwdeveloper.tiktok.data.models.users.User;
|
|||||||
import io.github.jwdeveloper.tiktok.data.requests.LiveUserData;
|
import io.github.jwdeveloper.tiktok.data.requests.LiveUserData;
|
||||||
import io.github.jwdeveloper.tiktok.exceptions.TikTokLiveRequestException;
|
import io.github.jwdeveloper.tiktok.exceptions.TikTokLiveRequestException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class LiveUserDataMapper
|
public class LiveUserDataMapper
|
||||||
@@ -109,7 +109,7 @@ public class LiveUserDataMapper
|
|||||||
roomInfo.setRoomId(roomId);
|
roomInfo.setRoomId(roomId);
|
||||||
roomInfo.setTitle(roomInfoJson.get("title").getAsString());
|
roomInfo.setTitle(roomInfoJson.get("title").getAsString());
|
||||||
roomInfo.setStartTime(roomInfoJson.get("startTime").getAsLong());
|
roomInfo.setStartTime(roomInfoJson.get("startTime").getAsLong());
|
||||||
roomInfo.setViewersCount(roomInfoJson.get("currentViewers").getAsInt());
|
roomInfo.setViewersCount(Optional.ofNullable(roomInfoJson.get("currentViewers")).filter(JsonElement::isJsonPrimitive).map(JsonElement::getAsInt).orElse(0));
|
||||||
roomInfo.setTotalViewersCount(roomInfoJson.get("totalViewers").getAsInt());
|
roomInfo.setTotalViewersCount(roomInfoJson.get("totalViewers").getAsInt());
|
||||||
|
|
||||||
var statusEnum = switch (status) {
|
var statusEnum = switch (status) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.11.5-Release</version>
|
<version>1.11.7-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<version>1.11.5-Release</version>
|
<version>1.11.7-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.11.5-Release</version>
|
<version>1.11.7-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>extension-recorder</artifactId>
|
<artifactId>extension-recorder</artifactId>
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.11.5-Release</version>
|
<version>1.11.7-Release</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>API</module>
|
<module>API</module>
|
||||||
<module>Client</module>
|
<module>Client</module>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.11.5-Release</version>
|
<version>1.11.7-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user