This commit is contained in:
Colin McDonald 2016-05-10 12:30:21 -04:00
parent 42ab0cab63
commit afbe2a68b5
7 changed files with 21 additions and 21 deletions

View File

@ -18,8 +18,8 @@ import java.util.UUID;
public final class AuditLogEntry {
@Getter @Id private String id;
@Getter @Indexed private UUID performedBy;
@Getter private String performedByIp;
@Getter @Indexed private UUID user;
@Getter private String userIp;
@Getter @Indexed private Date performedAt;
@Getter private String actorName;
@Getter private ActorType actorType;
@ -28,10 +28,10 @@ public final class AuditLogEntry {
public AuditLogEntry() {} // For Morphia
public AuditLogEntry(User performedBy, String performedByIp, Actor actor, AuditLogActionType actionType, Map<String, Object> actionData) {
public AuditLogEntry(User user, String userIp, Actor actor, AuditLogActionType actionType, Map<String, Object> actionData) {
this.id = new ObjectId().toString();
this.performedBy = performedBy.getId();
this.performedByIp = performedByIp;
this.user = user.getId();
this.userIp = userIp;
this.performedAt = new Date();
this.actorName = actor.getName();
this.actorType = actor.getType();

View File

@ -17,7 +17,7 @@ import java.util.UUID;
public final class Grant {
@Getter @Id private String id;
@Getter @Indexed private UUID target;
@Getter @Indexed private UUID user
@Getter private String reason;
@Getter private Set<String> scopes = new HashSet<>(); // So on things w/o scopes we still load properly (Morphia drops empty sets)
@Getter @Indexed private String rank;
@ -36,9 +36,9 @@ public final class Grant {
public Grant() {} // For Morphia
public Grant(User target, String reason, Set<ServerGroup> scopes, Rank rank, Date expiresAt, User addedBy) {
public Grant(User user, String reason, Set<ServerGroup> scopes, Rank rank, Date expiresAt, User addedBy) {
this.id = new ObjectId().toString();
this.target = target.getId();
this.user = user.getId();
this.reason = reason;
this.scopes = new HashSet<>(Collections2.transform(scopes, ServerGroup::getId));
this.rank = rank.getId();

View File

@ -16,17 +16,17 @@ public final class IPLogEntry {
@Getter @Id private String id;
@Getter @ExcludeFromReplies @Indexed private UUID user;
@Getter @Indexed private String ip;
@Getter @Indexed private String userIp;
@Getter private Date firstSeen;
@Getter private Date lastSeen;
@Getter private int uses;
public IPLogEntry() {} // For Morphia
public IPLogEntry(User user, String ip) {
public IPLogEntry(User user, String userIp) {
this.id = new ObjectId().toString();
this.user = user.getId();
this.ip = ip;
this.userIp = userIp;
this.firstSeen = new Date();
this.lastSeen = new Date();
this.uses = 0;

View File

@ -18,7 +18,7 @@ import java.util.UUID;
public final class Punishment {
@Getter @Id private String id;
@Getter @Indexed private UUID target;
@Getter @Indexed private UUID user;
@Getter private String reason;
@Getter @Indexed private PunishmentType type; // Type is indexed for the rank dump
@Getter private Date expiresAt;
@ -39,9 +39,9 @@ public final class Punishment {
public Punishment() {} // For Morphia
public Punishment(User target, String reason, PunishmentType type, Date expiresAt, User addedBy, Actor actor, Map<String, Object> meta) {
public Punishment(User user, String reason, PunishmentType type, Date expiresAt, User addedBy, Actor actor, Map<String, Object> meta) {
this.id = new ObjectId().toString();
this.target = target.getId();
this.user = user.getId();
this.reason = reason;
this.type = type;
this.expiresAt = expiresAt;

View File

@ -18,7 +18,7 @@ public final class Server {
@Getter private String displayName;
@Getter @ExcludeFromReplies String apiKey;
@Getter @Indexed private String group;
@Getter private String ip;
@Getter private String serverIp;
@Getter @Setter private Date lastUpdate;
@Getter @Setter private double lastTps;
@Getter @Setter @ExcludeFromReplies private Set<UUID> players;
@ -33,13 +33,13 @@ public final class Server {
public Server() {} // For Morphia
public Server(String id, String bungeeId, String displayName, String apiKey, ServerGroup group, String ip) {
public Server(String id, String bungeeId, String displayName, String apiKey, ServerGroup group, String serverIp) {
this.id = id;
this.bungeeId = bungeeId;
this.displayName = displayName;
this.apiKey = apiKey;
this.group = group.getId();
this.ip = ip;
this.serverIp = serverIp;
this.lastUpdate = new Date();
this.lastTps = 0;
this.players = new HashSet<>();

View File

@ -25,7 +25,7 @@ public final class GETDump implements Route {
APIv3.getDatastore().createQuery(Punishment.class).field("type").equal(type.toUpperCase()).forEach((punishment) -> {
if (punishment.isActive()) {
effectedUsers.add(punishment.getTarget());
effectedUsers.add(punishment.getUser());
}
});
@ -40,7 +40,7 @@ public final class GETDump implements Route {
Punishment.PunishmentType.BLACKLIST
)).forEach((punishment) -> {
if (punishment.isActive()) {
effectedUsers2.add(punishment.getTarget());
effectedUsers2.add(punishment.getUser());
}
});
@ -57,7 +57,7 @@ public final class GETDump implements Route {
grantDump.put(grant.getRank(), users);
}
users.add(grant.getTarget());
users.add(grant.getUser());
}
});

View File

@ -34,7 +34,7 @@ public final class GETStaff implements Route {
APIv3.getDatastore().createQuery(Grant.class).field("rank").in(staffRanks.keySet()).forEach(grant -> {
if (grant.isActive()) {
User user = User.byId(grant.getTarget());
User user = User.byId(grant.getUser());
Rank rank = staffRanks.get(grant.getRank());
if (!result.containsKey(rank.getId())) {