mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-30 14:30:08 +08:00
fix: migrate to new jdbi annotations
This commit is contained in:
parent
60762e146f
commit
c6b91b1f96
@ -2,11 +2,11 @@ package io.papermc.hangar.model.db.roles;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.jdbi.v3.core.annotation.JdbiProperty;
|
||||
import io.papermc.hangar.model.common.roles.Role;
|
||||
import io.papermc.hangar.model.db.Table;
|
||||
import io.papermc.hangar.model.internal.logs.contexts.LogContext;
|
||||
import io.papermc.hangar.model.loggable.Loggable;
|
||||
import org.jdbi.v3.core.annotation.Unmappable;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
@ -68,7 +68,7 @@ public abstract class ExtendedRoleTable<R extends Role<? extends IRoleTable<R>>,
|
||||
this.accepted = accepted;
|
||||
}
|
||||
|
||||
@Unmappable
|
||||
@JdbiProperty(map=false)
|
||||
public abstract long getPrincipalId();
|
||||
|
||||
@Override
|
||||
|
@ -2,7 +2,7 @@ package io.papermc.hangar.model.db.roles;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import org.jdbi.v3.core.annotation.Unmappable;
|
||||
import org.jdbi.v3.core.annotation.JdbiProperty;
|
||||
import org.jdbi.v3.core.mapper.reflect.ColumnName;
|
||||
import org.jdbi.v3.core.mapper.reflect.JdbiConstructor;
|
||||
import org.springframework.lang.Nullable;
|
||||
@ -40,7 +40,7 @@ public class OrganizationRoleTable extends ExtendedRoleTable<OrganizationRole, O
|
||||
}
|
||||
|
||||
@Override
|
||||
@Unmappable
|
||||
@JdbiProperty(map=false)
|
||||
public long getPrincipalId() {
|
||||
return organizationId;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.papermc.hangar.model.common.roles.ProjectRole;
|
||||
import io.papermc.hangar.model.internal.logs.contexts.ProjectContext;
|
||||
import io.papermc.hangar.model.loggable.ProjectLoggable;
|
||||
import org.jdbi.v3.core.annotation.Unmappable;
|
||||
import org.jdbi.v3.core.annotation.JdbiProperty;
|
||||
import org.jdbi.v3.core.mapper.reflect.ColumnName;
|
||||
import org.jdbi.v3.core.mapper.reflect.JdbiConstructor;
|
||||
|
||||
@ -31,7 +31,7 @@ public class ProjectRoleTable extends ExtendedRoleTable<ProjectRole, ProjectCont
|
||||
return projectId;
|
||||
}
|
||||
|
||||
@Unmappable
|
||||
@JdbiProperty(map=false)
|
||||
@Override
|
||||
public long getPrincipalId() {
|
||||
return projectId;
|
||||
|
@ -2,7 +2,7 @@ package io.papermc.hangar.model.db.versions.downloads;
|
||||
|
||||
import io.papermc.hangar.model.db.Table;
|
||||
|
||||
import org.jdbi.v3.core.annotation.Unmappable;
|
||||
import org.jdbi.v3.core.annotation.JdbiProperty;
|
||||
import org.jdbi.v3.core.mapper.reflect.JdbiConstructor;
|
||||
|
||||
import java.net.InetAddress;
|
||||
@ -70,12 +70,12 @@ public class ProjectVersionDownloadWarningTable extends Table {
|
||||
this.downloadId = downloadId;
|
||||
}
|
||||
|
||||
@Unmappable
|
||||
@JdbiProperty(map=false)
|
||||
public static String cookieKey(long versionId) {
|
||||
return "_warning_" + versionId;
|
||||
}
|
||||
|
||||
@Unmappable
|
||||
@JdbiProperty(map=false)
|
||||
public boolean hasExpired() {
|
||||
return expiresAt.isBefore(OffsetDateTime.now());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user