staff_mgr/README.md

39 lines
1.2 KiB
Markdown
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.

# staff-mgr 员工管理模块
Web 版本人事系统的员工管理后端服务,提供员工 CRUD、敏感信息脱敏、变更记录、操作审计日志、工号查重及部门缓存接口。
## 技术栈
- Spring Boot 3.2 / Spring Data JPA / Spring Security + JWT
- MySQL 8.0(生产)/ H2(本地开发与测试)
- Maven
## 接口
基础路径:`/api/v1/staff`,除 Swagger 与 H2 控制台外均需 `Authorization: Bearer <token>`。
| 方法 | 路径 | 说明 |
|------|------|------|
| POST | `/api/v1/staff` | 创建员工 |
| GET | `/api/v1/staff` | 分页列表查询 |
| GET | `/api/v1/staff/{id}` | 员工详情(按角色脱敏/数据权限) |
| PUT | `/api/v1/staff/{id}` | 部分更新员工 |
| DELETE | `/api/v1/staff/{id}` | 逻辑删除员工 |
| POST | `/api/v1/staff/batch-delete` | 批量删除 |
| GET | `/api/v1/staff/{id}/change-logs` | 变更记录 |
| GET | `/api/v1/staff/audit-logs` | 操作日志(Admin 专属) |
| GET | `/api/v1/staff/check/employee-no` | 工号查重 |
| GET | `/api/v1/staff/departments` | 部门缓存列表 |
## 本地运行
```bash
# 开发环境(H2 内存库)
mvn spring-boot:run
# 生产环境(MySQL)
mvn spring-boot:run -Dspring-boot.run.profiles=mysql
```
## 测试
```bash
mvn test
```