add message snipe feature

This commit is contained in:
Lee
2024-07-01 21:20:39 +01:00
parent 727a4c9a6f
commit 8b451c6ee5
16 changed files with 562 additions and 3 deletions

View File

@ -4,6 +4,8 @@ import cc.fascinated.bat.BatApplication;
import lombok.Getter;
import lombok.SneakyThrows;
import org.bson.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
@ -13,6 +15,7 @@ import java.util.Map;
*/
@Getter
public abstract class ProfileHolder {
private static final Logger log = LoggerFactory.getLogger(ProfileHolder.class);
/**
* The profiles for the holder
*/
@ -38,6 +41,8 @@ public abstract class ProfileHolder {
Serializable profile = getProfiles().get(clazz.getSimpleName());
if (profile == null) {
T newProfile = clazz.cast(clazz.getDeclaredConstructors()[0].newInstance());
log.info("instance of profiles: {}", document.get("profiles").getClass().getSimpleName());
Document profiles = document.get("profiles", new org.bson.Document());
Document profileDocument = (Document) profiles.get(clazz.getSimpleName());