Recruitment_site/.superpowers/brainstorm/3597-1774339647/data-model.html

209 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h2>数据模型设计</h2>
<p class="subtitle">核心表结构与关联关系</p>
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px;">
<!-- Organization -->
<div style="background: #1e293b; border-radius: 10px; overflow: hidden; border: 1px solid #334155;">
<div style="background: #0c4a6e; padding: 10px 14px; display: flex; align-items: center; gap: 8px;">
<span style="font-size: 16px;">🏢</span>
<span style="font-weight: 700; color: #e2e8f0;">Organization 组织架构</span>
</div>
<div style="padding: 12px 14px;">
<table style="width: 100%; font-size: 12px; border-collapse: collapse;">
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #fbbf24; font-weight: 600;">id</td>
<td style="padding: 5px 0; color: #94a3b8;">PK</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">name</td>
<td style="padding: 5px 0; color: #94a3b8;">公司名称</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">parent</td>
<td style="padding: 5px 0; color: #94a3b8;">FK → self集团/子公司)</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">logo</td>
<td style="padding: 5px 0; color: #94a3b8;">公司 Logo</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">description</td>
<td style="padding: 5px 0; color: #94a3b8;">公司简介</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #e2e8f0;">is_active</td>
<td style="padding: 5px 0; color: #94a3b8;">是否启用</td>
</tr>
</table>
</div>
</div>
<!-- User -->
<div style="background: #1e293b; border-radius: 10px; overflow: hidden; border: 1px solid #334155;">
<div style="background: #312e81; padding: 10px 14px; display: flex; align-items: center; gap: 8px;">
<span style="font-size: 16px;">👤</span>
<span style="font-weight: 700; color: #e2e8f0;">User 用户</span>
</div>
<div style="padding: 12px 14px;">
<table style="width: 100%; font-size: 12px; border-collapse: collapse;">
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #fbbf24; font-weight: 600;">id</td>
<td style="padding: 5px 0; color: #94a3b8;">PK</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">username / email</td>
<td style="padding: 5px 0; color: #94a3b8;">登录账号</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">phone</td>
<td style="padding: 5px 0; color: #94a3b8;">手机号</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #34d399; font-weight: 600;">role</td>
<td style="padding: 5px 0; color: #94a3b8;">superadmin / admin / seeker</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">organization</td>
<td style="padding: 5px 0; color: #94a3b8;">FK → Organizationadmin 用)</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #e2e8f0;">is_active</td>
<td style="padding: 5px 0; color: #94a3b8;">账号状态</td>
</tr>
</table>
</div>
</div>
<!-- Job -->
<div style="background: #1e293b; border-radius: 10px; overflow: hidden; border: 1px solid #334155;">
<div style="background: #14532d; padding: 10px 14px; display: flex; align-items: center; gap: 8px;">
<span style="font-size: 16px;">💼</span>
<span style="font-weight: 700; color: #e2e8f0;">Job 职位</span>
</div>
<div style="padding: 12px 14px;">
<table style="width: 100%; font-size: 12px; border-collapse: collapse;">
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #fbbf24; font-weight: 600;">id</td>
<td style="padding: 5px 0; color: #94a3b8;">PK</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">organization</td>
<td style="padding: 5px 0; color: #94a3b8;">FK → Organization</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">title</td>
<td style="padding: 5px 0; color: #94a3b8;">职位名称</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">category</td>
<td style="padding: 5px 0; color: #94a3b8;">职位类别</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">location / salary</td>
<td style="padding: 5px 0; color: #94a3b8;">地点 / 薪资</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">description</td>
<td style="padding: 5px 0; color: #94a3b8;">职位描述(富文本)</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #34d399; font-weight: 600;">status</td>
<td style="padding: 5px 0; color: #94a3b8;">draft / published / closed</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #e2e8f0;">created_at</td>
<td style="padding: 5px 0; color: #94a3b8;">发布时间</td>
</tr>
</table>
</div>
</div>
<!-- Resume -->
<div style="background: #1e293b; border-radius: 10px; overflow: hidden; border: 1px solid #334155;">
<div style="background: #78350f; padding: 10px 14px; display: flex; align-items: center; gap: 8px;">
<span style="font-size: 16px;">📄</span>
<span style="font-weight: 700; color: #e2e8f0;">Resume 简历</span>
</div>
<div style="padding: 12px 14px;">
<table style="width: 100%; font-size: 12px; border-collapse: collapse;">
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #fbbf24; font-weight: 600;">id</td>
<td style="padding: 5px 0; color: #94a3b8;">PK</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">user</td>
<td style="padding: 5px 0; color: #94a3b8;">FK → User求职者</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">name / gender / birthday</td>
<td style="padding: 5px 0; color: #94a3b8;">基本信息</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">education (JSON)</td>
<td style="padding: 5px 0; color: #94a3b8;">教育经历列表</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">experience (JSON)</td>
<td style="padding: 5px 0; color: #94a3b8;">工作经历列表</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #e2e8f0;">attachment</td>
<td style="padding: 5px 0; color: #94a3b8;">简历附件PDF/Word</td>
</tr>
</table>
</div>
</div>
<!-- Application -->
<div style="background: #1e293b; border-radius: 10px; overflow: hidden; border: 1px solid #334155; grid-column: span 1;">
<div style="background: #7f1d1d; padding: 10px 14px; display: flex; align-items: center; gap: 8px;">
<span style="font-size: 16px;">📨</span>
<span style="font-weight: 700; color: #e2e8f0;">Application 投递记录</span>
</div>
<div style="padding: 12px 14px;">
<table style="width: 100%; font-size: 12px; border-collapse: collapse;">
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #fbbf24; font-weight: 600;">id</td>
<td style="padding: 5px 0; color: #94a3b8;">PK</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">job</td>
<td style="padding: 5px 0; color: #94a3b8;">FK → Job</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">applicant</td>
<td style="padding: 5px 0; color: #94a3b8;">FK → User</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">resume</td>
<td style="padding: 5px 0; color: #94a3b8;">FK → Resume投递时快照</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #34d399; font-weight: 600;">status</td>
<td style="padding: 5px 0; color: #94a3b8;">待查看 → 已查看 → 面试 → 录用/拒绝</td>
</tr>
<tr style="border-bottom: 1px solid #1e3a5f;">
<td style="padding: 5px 0; color: #e2e8f0;">note</td>
<td style="padding: 5px 0; color: #94a3b8;">HR 备注</td>
</tr>
<tr>
<td style="padding: 5px 0; color: #e2e8f0;">applied_at</td>
<td style="padding: 5px 0; color: #94a3b8;">投递时间</td>
</tr>
</table>
</div>
</div>
</div>
<div style="margin-top: 16px; background: #0f172a; border-radius: 8px; padding: 14px; border: 1px solid #334155; font-size: 12px; color: #94a3b8;">
<strong style="color: #e2e8f0;">关键设计说明:</strong>
<ul style="margin: 8px 0 0 16px; line-height: 2;">
<li>Organization 自关联支持集团→子公司层级</li>
<li>User.role 控制权限superadmin 管全局admin 只能操作本公司数据</li>
<li>Resume.education / experience 用 PostgreSQL JSONB 存储,灵活应对结构差异</li>
<li>Application 投递时关联当前简历,保证历史记录不受简历修改影响</li>
</ul>
</div>