continuous-integration/drone/pr Build is passing
users.is_admin (V8) — ставит только служебное API (PUT /api/service/accounts с "admin"), ящик сам себя администратором не сделает. MailAdmins: список из конфигурации + выданные Jambotron (загружаются при старте, меняются сразу). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80 lines
2.4 KiB
Java
80 lines
2.4 KiB
Java
package com.mailserver.domain;
|
|
|
|
import org.springframework.data.annotation.Id;
|
|
import org.springframework.data.relational.core.mapping.Column;
|
|
import org.springframework.data.relational.core.mapping.Table;
|
|
|
|
import java.time.Instant;
|
|
|
|
@Table("users")
|
|
public class User {
|
|
|
|
@Id
|
|
private Long id;
|
|
|
|
@Column("email")
|
|
private String email;
|
|
|
|
@Column("password")
|
|
private String password;
|
|
|
|
@Column("display_name")
|
|
private String displayName;
|
|
|
|
@Column("quota_bytes")
|
|
private Long quotaBytes = 1024L * 1024 * 1024;
|
|
|
|
@Column("used_bytes")
|
|
private Long usedBytes = 0L;
|
|
|
|
@Column("is_active")
|
|
private boolean isActive = true;
|
|
|
|
/** Trap: what this mailbox sends is stored in its own INBOX, never delivered (V5). */
|
|
@Column("is_trap")
|
|
private boolean isTrap = false;
|
|
|
|
/** Mail administrator given by Jambotron through the service API (V8); plus mailserver.admins. */
|
|
@Column("is_admin")
|
|
private boolean isAdmin = false;
|
|
|
|
/** Shared mailbox (V7): no login of its own, members open it. */
|
|
@Column("is_shared")
|
|
private boolean isShared = false;
|
|
|
|
@Column("created_at")
|
|
private Instant createdAt;
|
|
|
|
public Long getId() { return id; }
|
|
public void setId(Long id) { this.id = id; }
|
|
|
|
public String getEmail() { return email; }
|
|
public void setEmail(String email) { this.email = email; }
|
|
|
|
public String getPassword() { return password; }
|
|
public void setPassword(String password) { this.password = password; }
|
|
|
|
public String getDisplayName() { return displayName; }
|
|
public void setDisplayName(String displayName) { this.displayName = displayName; }
|
|
|
|
public Long getQuotaBytes() { return quotaBytes; }
|
|
public void setQuotaBytes(Long quotaBytes) { this.quotaBytes = quotaBytes; }
|
|
|
|
public Long getUsedBytes() { return usedBytes; }
|
|
public void setUsedBytes(Long usedBytes) { this.usedBytes = usedBytes; }
|
|
|
|
public boolean isActive() { return isActive; }
|
|
public void setActive(boolean active) { isActive = active; }
|
|
|
|
public boolean isTrap() { return isTrap; }
|
|
public void setTrap(boolean trap) { isTrap = trap; }
|
|
public boolean isAdmin() { return isAdmin; }
|
|
public void setAdmin(boolean admin) { isAdmin = admin; }
|
|
|
|
public boolean isShared() { return isShared; }
|
|
public void setShared(boolean shared) { isShared = shared; }
|
|
|
|
public Instant getCreatedAt() { return createdAt; }
|
|
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
|
}
|