feat(guild): MyPage guild_notification + load_index audit
- Replace GuildNotification TODO stub in MyPageController.Index with BuildGuildNotificationAsync: populates guild_id, guild_room_message_id, is_join_request, is_invited from real DB state. - Inject IGuildService, IGuildInviteRepository, IGuildJoinRequestRepository, IGuildChatMessageRepository into MyPageController. - Add GetMaxMessageIdSafelyAsync to IGuildChatMessageRepository (returns null when no messages exist, vs GetMaxMessageIdAsync which returns 0). - LoadDetail.cs audit: grep returned no guild fields — no LoadController changes. - Add GuildCrossSurfaceTests (4 tests): guild member, pending invite, pending join request, no-guild viewer all verified green. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -142,6 +142,12 @@ public sealed class GuildChatMessageRepository : IGuildChatMessageRepository
|
||||
return max ?? 0;
|
||||
}
|
||||
|
||||
public async Task<long?> GetMaxMessageIdSafelyAsync(int guildId, CancellationToken ct = default)
|
||||
{
|
||||
var v = await GetMaxMessageIdAsync(guildId, ct);
|
||||
return v == 0 ? null : (long?)v;
|
||||
}
|
||||
|
||||
public async Task DeleteAllForGuildAsync(int guildId, CancellationToken ct = default)
|
||||
{
|
||||
var messages = await _db.GuildChatMessages.Where(m => m.GuildId == guildId).ToListAsync(ct);
|
||||
|
||||
Reference in New Issue
Block a user