基于现有SilverUserProfile实体,为管理后台设计完整的银龄库(银卡库)管理系统,实现对银龄人才的全面管理功能。
使用现有的SilverUserProfile实体,包含以下核心字段:
src/server/api/silver-talents-admin/
├── index.ts # 路由聚合
├── get.ts # 管理列表查询
├── [id]/
│ ├── get.ts # 管理详情查询
│ ├── put.ts # 管理员更新
│ └── patch.ts # 认证状态更新
└── stats.ts # 统计数据
在SilverTalentService基础上增加管理功能:
findForAdmin() - 管理后台专用查询updateByAdmin() - 管理员更新功能batchUpdateCertification() - 批量认证更新getStats() - 统计数据获取在src/client/admin/menu.tsx中添加:
{
key: 'silver-talents',
label: '银龄库管理',
icon: <UserOutlined />,
path: '/admin/silver-talents',
permission: 'silver-talent:manage'
}
在src/client/admin/routes.tsx中添加:
{
path: 'silver-talents',
element: <SilverTalentsPage />,
errorElement: <ErrorPage />
}
src/client/admin/pages/SilverTalents/
├── index.tsx # 列表页面
├── Detail.tsx # 详情页面
├── components/
│ ├── TalentTable.tsx # 人才表格
│ ├── TalentForm.tsx # 编辑表单
│ ├── CertificationModal.tsx # 认证弹窗
│ └── StatsCard.tsx # 统计卡片
└── hooks/
└── useTalentData.ts # 数据钩子
-- 为管理查询优化索引
CREATE INDEX idx_silver_profile_name ON silver_user_profiles(real_name);
CREATE INDEX idx_silver_profile_age ON silver_user_profiles(age);
CREATE INDEX idx_silver_profile_cert_status ON silver_user_profiles(certification_status);
CREATE INDEX idx_silver_profile_job_status ON silver_user_profiles(job_seeking_status);
在权限系统中添加:
silver-talent:read - 查看银龄人才silver-talent:write - 编辑银龄人才silver-talent:certify - 认证管理silver-talent:delete - 删除银龄人才GET /api/v1/admin/silver-talents
参数:
- page: 页码
- pageSize: 每页数量
- keyword: 关键词搜索
- certificationStatus: 认证状态筛选
- jobSeekingStatus: 求职状态筛选
- ageMin/ageMax: 年龄范围
- sortBy: 排序字段
- sortOrder: 排序方向
响应:
{
data: SilverUserProfile[],
pagination: {...},
stats: {...}
}
PATCH /api/v1/admin/silver-talents/:id/certification
请求体:
{
certificationStatus: "CERTIFIED" | "REJECTED",
certificationInfo: string,
reason?: string
}
GET /api/v1/admin/silver-talents/stats
响应:
{
totalCount: number,
certifiedCount: number,
pendingCount: number,
rejectedCount: number,
ageDistribution: {...},
skillDistribution: {...}
}
const columns = [
{ title: '姓名', dataIndex: 'realName', key: 'realName' },
{ title: '年龄', dataIndex: 'age', key: 'age', sorter: true },
{ title: '所属机构', dataIndex: 'organization', key: 'organization' },
{ title: '认证状态', dataIndex: 'certificationStatus', key: 'certificationStatus',
render: (status) => <Tag color={getStatusColor(status)}>{getStatusText(status)}</Tag> },
{ title: '求职状态', dataIndex: 'jobSeekingStatus', key: 'jobSeekingStatus' },
{ title: '积分', dataIndex: 'totalPoints', key: 'totalPoints', sorter: true },
{ title: '操作', key: 'action', render: (_, record) => <ActionButtons /> }
];