diff --git a/DesignDiagrams b/DesignDiagrams new file mode 100644 index 0000000..a31eafd --- /dev/null +++ b/DesignDiagrams @@ -0,0 +1,75 @@ +设计图示(类图与时序图) + +1. 类关系图(简化) +```mermaid +classDiagram + class DeptController + class EmployeeController + class EmployeeKpiController + class HireNumController + class SalaryLevelController + class LoginController + class CaptchaController + + class IDeptService + class IEmployeeService + class IEmployeeKpiService + class IHireNumService + class ISalaryLevelService + + class Dept + class Employee + class EmployeeKpi + class HireNum + class SalaryLevel + + DeptController --> IDeptService + EmployeeController --> IEmployeeService + EmployeeKpiController --> IEmployeeKpiService + HireNumController --> IHireNumService + SalaryLevelController --> ISalaryLevelService + + IDeptService --> Dept + IEmployeeService --> Employee + IEmployeeKpiService --> EmployeeKpi + IHireNumService --> HireNum + ISalaryLevelService --> SalaryLevel +``` + +2. 登录时序图 +```mermaid +sequenceDiagram + participant U as User + participant FE as Frontend(Vue) + participant BE as Backend(Spring Boot) + participant REDIS as Redis + + U->>FE: 打开登录页 + FE->>BE: GET /captchaImage + BE->>REDIS: 保存(uuid -> code) + BE-->>FE: uuid, img(Base64) + U->>FE: 输入 username/password/code + FE->>BE: POST /login {username,password,code,uuid} + BE->>REDIS: 校验 code + BE-->>FE: token + FE->>FE: 保存 Admin-Token(Cookie) +``` + +3. 分页查询时序图 +```mermaid +sequenceDiagram + participant FE as Frontend + participant CTRL as Controller + participant SVC as Service + participant DAO as Mapper/Repo + + FE->>CTRL: GET //list?query + CTRL->>CTRL: startPage() + CTRL->>SVC: select*List(query) + SVC->>DAO: 查询 + DAO-->>SVC: 列表数据 + SVC-->>CTRL: 列表数据 + CTRL-->>FE: TableDataInfo +``` + +