Files
Environment-Monitoring-System/Report/UML类图.md
ChuXun 02a830145e 1
2025-10-25 19:18:43 +08:00

159 lines
2.7 KiB
Markdown

```
@startuml
class UserAccount {
- Long id
- String name
- String email
- Role role
- UserStatus status
- Integer gridX
- Integer gridY
+ isAccountLocked(): boolean
+ hasSkill(String skill): boolean
}
enum Role { ADMIN, SUPERVISOR, GRID_WORKER }
enum UserStatus { ACTIVE, INACTIVE, SUSPENDED }
UserAccount *-- Role
UserAccount *-- UserStatus
@enduml
```
@startuml
class Feedback {
- Long id
- String eventId
- String title
- PollutionType pollutionType
- SeverityLevel severityLevel
- FeedbackStatus status
- Long submitterId
+ updateStatus(newStatus)
+ isHighPriority(): boolean
}
class Attachment {
+ id: Long
+ fileName: String
+ fileType: String
+ storedFileName: String
}
enum FeedbackStatus { PENDING_REVIEW, PROCESSED, AI_REJECTED, TASK_CREATED, CLOSED }
Feedback "1" -- "*" Attachment : has
Feedback *-- FeedbackStatus
UserAccount "1" -- "*" Feedback : submits
@enduml
@startuml
class Task {
- Long id
- Long feedbackId
- Long assigneeId
- Long creatorId
- TaskStatus status
- SeverityLevel priority
+ assignTo(userId)
+ markAsCompleted()
}
class Assignment {
- Long id
- Long taskId
- Long assigneeId
- AssignmentStatus status
+ accept()
}
class TaskHistory {
- Long id
- Task task
- TaskStatus oldStatus
- TaskStatus newStatus
- UserAccount changedBy
}
enum TaskStatus { CREATED, ASSIGNED, IN_PROGRESS, SUBMITTED, APPROVED, REJECTED, CANCELED }
Task "1" -- "1" Feedback : created_from
Task "1" -- "*" Assignment
Task "1" -- "*" TaskHistory
UserAccount "1" -- "*" Task : assigned_to
Task *-- TaskStatus
@enduml
@startuml
class Grid {
- Long id
- Integer gridX
- Integer gridY
- String cityName
- boolean isObstacle
}
class MapGrid {
- Long id
- int x
- int y
- boolean isObstacle
- String terrainType
}
@enduml
```
@startuml
class AqiData {
- Long id
- Grid grid
- Long reporterId
- Integer aqiValue
- String primaryPollutant
}
class AqiRecord {
- Long id
- String cityName
- Integer aqiValue
- LocalDateTime recordTime
}
class PollutantThreshold {
- Long id
- String pollutantName
- Double threshold
- String unit
}
@enduml
```
@startuml
class OperationLog {
- Long id
- UserAccount user
- OperationType operationType
- String description
- LocalDateTime createdAt
}
class PasswordResetToken {
- Long id
- String token
- UserAccount user
- LocalDateTime expiryDate
+ isExpired(): boolean
}
class TaskSubmission {
- Long id
- Task task
- String notes
- LocalDateTime submittedAt
}
class AssignmentRecord {
- Long id
- Feedback feedback
- UserAccount gridWorker
- UserAccount admin
- AssignmentMethod assignmentMethod
}
@enduml