diff --git a/src/api/boardApi.js b/src/api/boardApi.js index 4700ff5..65cd1a2 100644 --- a/src/api/boardApi.js +++ b/src/api/boardApi.js @@ -17,6 +17,13 @@ export const boardApi = { get(id) { return http.get(`/board/posts/${id}`) }, + // 내 글/댓글 모아보기 + myPosts({ page = 1, size = 10 } = {}) { + return http.get('/board/my/posts', { params: { page, size } }) + }, + myComments({ page = 1, size = 10 } = {}) { + return http.get('/board/my/comments', { params: { page, size } }) + }, create(payload) { return http.post('/board/posts', payload) }, diff --git a/src/components/layout/AppHeader.vue b/src/components/layout/AppHeader.vue index eb29fa0..9cf0e80 100644 --- a/src/components/layout/AppHeader.vue +++ b/src/components/layout/AppHeader.vue @@ -23,6 +23,7 @@ const TITLES = { 'account-categories': '분류 관리', 'account-budget': '예산 설정', 'account-tags': '태그 관리', + 'my-board': '내 글·댓글', users: '회원 관리', 'admin-tags': '태그 관리(관리자)', 'admin-default-categories': '기본 분류 설정', diff --git a/src/components/layout/AppSidebar.vue b/src/components/layout/AppSidebar.vue index 430b86e..4d2dbba 100644 --- a/src/components/layout/AppSidebar.vue +++ b/src/components/layout/AppSidebar.vue @@ -85,6 +85,10 @@ const icons = { {{ b.label }} 🔒 + + + 내 글·댓글 + diff --git a/src/router/index.js b/src/router/index.js index f97770b..bd63d41 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -59,6 +59,12 @@ const router = createRouter({ component: () => import('../views/board/BoardListView.vue'), meta: { requiresAuth: true }, }, + { + path: '/my-board', + name: 'my-board', + component: () => import('../views/board/MyBoardView.vue'), + meta: { requiresAuth: true }, + }, { path: '/board/:category(community|saving|tips)/write', name: 'board-write', diff --git a/src/views/board/MyBoardView.vue b/src/views/board/MyBoardView.vue new file mode 100644 index 0000000..b4913c5 --- /dev/null +++ b/src/views/board/MyBoardView.vue @@ -0,0 +1,209 @@ + + + + + + 내 글 + 내 댓글 + + + {{ error }} + 불러오는 중... + + + + + + + + {{ boardLabel(p.category) }} + {{ p.title }} + + + {{ formatRelative(p.createdAt) }} + · 조회 {{ p.viewCount }} + · 추천 {{ p.upCount || 0 }} + · 댓글 {{ p.commentCount }} + + + + + + + + {{ boardLabel(c.category) }} + {{ c.postTitle }} + + {{ c.content }} + {{ formatRelative(c.createdAt) }} + + + + {{ tab === 'posts' ? '작성한 글이 없습니다.' : '작성한 댓글이 없습니다.' }} + + + ‹ + {{ page }} / {{ totalPages }} + › + + + + + +
{{ error }}
불러오는 중...
{{ tab === 'posts' ? '작성한 글이 없습니다.' : '작성한 댓글이 없습니다.' }}