feat(backend): global notices

This commit is contained in:
sam 2025-04-06 15:32:44 +02:00
parent 22be49976a
commit b07f4b75c0
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
19 changed files with 1247 additions and 8 deletions

View file

@ -14,6 +14,8 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// ReSharper disable NotAccessedPositionalProperty.Global
using Foxnouns.Backend.Database;
namespace Foxnouns.Backend.Dto;
public record MetaResponse(
@ -22,9 +24,12 @@ public record MetaResponse(
string Hash,
int Members,
UserInfoResponse Users,
LimitsResponse Limits
LimitsResponse Limits,
MetaNoticeResponse? Notice
);
public record MetaNoticeResponse(Snowflake Id, string Message);
public record UserInfoResponse(int Total, int ActiveMonth, int ActiveWeek, int ActiveDay);
public record LimitsResponse(

View file

@ -122,3 +122,13 @@ public record QueryUserResponse(
);
public record QuerySensitiveUserDataRequest(string Reason);
public record NoticeResponse(
Snowflake Id,
string Message,
Instant StartTime,
Instant EndTime,
PartialUser Author
);
public record CreateNoticeRequest(string Message, Instant? StartTime, Instant EndTime);

View file

@ -80,6 +80,7 @@ public record PartialUser(
public class UpdateUserSettingsRequest : PatchRequest
{
public bool? DarkMode { get; init; }
public Snowflake? LastReadNotice { get; init; }
}
public class CustomPreferenceUpdateRequest