Skip to content

Commit 5039497

Browse files
committed
docs: add article type job nav design spec
1 parent 16566ce commit 5039497

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Article Type Field — Job Navigation Design
2+
3+
## Overview
4+
5+
Add a `type` field to `articles` table to support article-type pages like 求职导航, separate from blog articles.
6+
7+
## Design
8+
9+
### Database
10+
11+
Add `type` column to `articles`:
12+
13+
```sql
14+
ALTER TABLE articles ADD COLUMN type VARCHAR(16) NOT NULL DEFAULT 'ARTICLE' AFTER status;
15+
```
16+
17+
### ArticleType Enum
18+
19+
```java
20+
public enum ArticleType {
21+
ARTICLE, // 博客文章
22+
JOB_NAV // 求职导航
23+
}
24+
```
25+
26+
### Backend
27+
28+
- `Article` entity: add `type` field
29+
- `ArticleService.listPublished()`: filter `type = ARTICLE`
30+
- `ArticleService.listByType(ArticleType type, page, size)`: new method for public type-filtered listing
31+
- `ArticleCreateRequest` / `ArticleUpdateRequest`: add optional `type` field
32+
- `ArticleController`: new `GET /articles/type/{type}` endpoint
33+
34+
### Frontend
35+
36+
- `BlogHeader.vue`: 求职导航 `href="#"``router-link to="/jobs"`
37+
- Router: add `/jobs` route
38+
- New `JobNavView.vue`: list job nav articles, reuses `ArticleCard` component
39+
- Article detail: reuse existing `ArticleDetailView.vue`
40+
- Console: article compose view adds type selector

0 commit comments

Comments
 (0)