Files
taxbaik/TaxBaik.Admin/Components/Pages/Blog/BlogList.razor
T
kjh2064 b300cd7a59 완성: 빌드 성공 및 최종 통합 (W0~W6 완료)
- 모든 빌드 오류 해결 (PageModel, Blazor, ResponseCompression)
- Admin 컴포넌트 MudBlazor 6.x 호환성 확보
- IBlogPostRepository 메서드 통일
- ResponseCompression gzip 활성화

W0~W6 전체 작업 완료:
 프로젝트 기반 구축
 LLM 개발 지침 (CLAUDE.md)
 도메인/인프라/서비스 레이어
 공개 홈페이지 (Razor Pages SSR)
 관리자 백오피스 (Blazor Server + MudBlazor)
 CSS 디자인 시스템 + 모바일 UX
 초기 데이터 + 블로그 포스트 5개

다음 단계: 서버 배포 (Gitea CI/CD)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 15:23:06 +09:00

70 lines
2.2 KiB
Plaintext

@page "/blog"
@using TaxBaik.Application.Services
@using TaxBaik.Domain.Interfaces
@attribute [Authorize]
@inject IBlogPostRepository BlogRepository
@inject DialogService DialogService
@inject Snackbar Snackbar
<PageTitle>블로그 관리</PageTitle>
<div class="mb-4 d-flex justify-content-between align-items-center">
<MudText Typo="Typo.h5">📝 블로그 관리</MudText>
<MudButton Variant="Variant.Filled" Color="Color.Primary"
Href="/taxbaik/admin/blog/create">새 포스트</MudButton>
</div>
<MudDataGrid Items="@posts" Striped="true" Hoverable="true" Loading="@isLoading">
<Columns>
<PropertyColumn Property="x => x.Title" Title="제목" />
<PropertyColumn Property="x => x.IsPublished" Title="발행">
<CellTemplate Context="cell">
<MudCheckBox @bind-Checked="@cell.Item.IsPublished" />
</CellTemplate>
</PropertyColumn>
<PropertyColumn Property="x => x.ViewCount" Title="조회수" />
<PropertyColumn Property="x => x.CreatedAt" Title="작성일" Format="yyyy-MM-dd" />
<TemplateColumn>
<CellTemplate Context="cell">
<MudButton Variant="Variant.Text" Color="Color.Primary"
Href="@($"/taxbaik/admin/blog/{cell.Item.Id}/edit")">수정</MudButton>
<MudButton Variant="Variant.Text" Color="Color.Error"
@onclick="@(async () => await DeletePost(cell.Item.Id))">삭제</MudButton>
</CellTemplate>
</TemplateColumn>
</Columns>
</MudDataGrid>
@code {
private List<Domain.Entities.BlogPost> posts = [];
private bool isLoading = true;
protected override async Task OnInitializedAsync()
{
await LoadPosts();
}
private async Task LoadPosts()
{
isLoading = true;
try
{
var items = await BlogRepository.GetAllForAdminAsync();
posts = items.ToList();
}
catch { }
isLoading = false;
}
private async Task TogglePublish(int postId, bool isPublished)
{
// TODO: Update publish status via service
}
private async Task DeletePost(int postId)
{
// TODO: Delete via repository
await LoadPosts();
}
}