서버 게시글

This commit is contained in:
2026-09-03 19:18:46 +09:00
parent 807cd89a9a
commit 78c2ce676a
30 changed files with 7456 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace GameServer.Models.Portfolio
{
// 포트폴리오 카테고리 (게임 / 개발 / 아트 / 기록)
[Table("tb_portfolio_category")]
public class PortfolioCategoryModel
{
[Key]
[Column("category_no")]
public int CategoryNo { get; set; }
// URL 에 쓰이는 식별자 (예: game, dev, art, log)
[Required]
[Column("slug")]
public string Slug { get; set; } = string.Empty;
[Required]
[Column("name")]
public string Name { get; set; } = string.Empty;
[Column("description")]
public string? Description { get; set; }
// 카테고리 강조 색상 (예: #7c5cff)
[Column("accent")]
public string? Accent { get; set; }
[Column("sort_order")]
public int SortOrder { get; set; }
[Column("created_at")]
public DateTime CreatedAt { get; set; }
}
}

View File

@@ -0,0 +1,105 @@
namespace GameServer.Models.Portfolio
{
// 카테고리 조회 응답
public class CategoryDto
{
public int CategoryNo { get; set; }
public string Slug { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public string? Accent { get; set; }
public int SortOrder { get; set; }
// 해당 카테고리에 속한 게시물 수
public int PostCount { get; set; }
}
// 카테고리 생성/수정 요청
public class CategoryUpsertDto
{
public string Slug { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public string? Accent { get; set; }
public int SortOrder { get; set; }
}
// 게시물 이미지 조회 응답
public class PostImageDto
{
public int ImageNo { get; set; }
public string ImageUrl { get; set; } = string.Empty;
public string? Caption { get; set; }
public int SortOrder { get; set; }
}
// 목록용 게시물 요약 (카테고리 정보 포함)
public class PostSummaryDto
{
public int PostNo { get; set; }
public int CategoryNo { get; set; }
public string CategorySlug { get; set; } = string.Empty;
public string CategoryName { get; set; } = string.Empty;
public string? CategoryAccent { get; set; }
public string Title { get; set; } = string.Empty;
public string? Summary { get; set; }
public string? ThumbnailUrl { get; set; }
public int ImageCount { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}
// 상세 조회 응답 (본문 + 이미지 목록 추가)
public class PostDetailDto : PostSummaryDto
{
public string? ContentMd { get; set; }
public List<PostImageDto> Images { get; set; } = new();
}
// 게시물 생성/수정 요청
public class PostUpsertDto
{
public int CategoryNo { get; set; }
public string Title { get; set; } = string.Empty;
public string? Summary { get; set; }
public string? ContentMd { get; set; }
public string? ThumbnailUrl { get; set; }
public List<PostImageUpsertDto> Images { get; set; } = new();
}
// 게시물 이미지 생성/수정 요청
public class PostImageUpsertDto
{
public string ImageUrl { get; set; } = string.Empty;
public string? Caption { get; set; }
public int SortOrder { get; set; }
}
// 관리자 로그인 요청
public class LoginRequestDto
{
public string Password { get; set; } = string.Empty;
}
// 로그인 상태 응답
public class AuthStateDto
{
public bool Authenticated { get; set; }
}
// 이미지 업로드 결과
public class UploadResultDto
{
public string Url { get; set; } = string.Empty;
public string FileName { get; set; } = string.Empty;
public long Size { get; set; }
}
/// <summary>업로드 한도 안내. 편집기가 보내기 전에 미리 확인하는 용도입니다.</summary>
public class UploadLimitDto
{
public long MaxBytes { get; set; }
public double MaxMegabytes { get; set; }
public List<string> AllowedExtensions { get; set; } = new();
}
}

View File

@@ -0,0 +1,30 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace GameServer.Models.Portfolio
{
// 게시물에 첨부된 이미지 (게시물 삭제 시 함께 삭제)
[Table("tb_portfolio_post_image")]
public class PortfolioPostImageModel
{
[Key]
[Column("image_no")]
public int ImageNo { get; set; }
[Column("post_no")]
public int PostNo { get; set; }
[Required]
[Column("image_url")]
public string ImageUrl { get; set; } = string.Empty;
[Column("caption")]
public string? Caption { get; set; }
[Column("sort_order")]
public int SortOrder { get; set; }
[Column("created_at")]
public DateTime CreatedAt { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace GameServer.Models.Portfolio
{
// 포트폴리오 게시물 본문 (마크다운으로 저장)
[Table("tb_portfolio_post")]
public class PortfolioPostModel
{
[Key]
[Column("post_no")]
public int PostNo { get; set; }
[Column("category_no")]
public int CategoryNo { get; set; }
[Required]
[Column("title")]
public string Title { get; set; } = string.Empty;
[Column("summary")]
public string? Summary { get; set; }
// 마크다운 원문
[Column("content_md")]
public string? ContentMd { get; set; }
[Column("thumbnail_url")]
public string? ThumbnailUrl { get; set; }
// 생성/수정 시각은 애플리케이션에서 DateTime.UtcNow 로 직접 기록한다.
[Column("created_at")]
public DateTime CreatedAt { get; set; }
[Column("updated_at")]
public DateTime UpdatedAt { get; set; }
}
}