|
@@ -1,75 +1,39 @@
|
|
|
@startuml
|
|
|
-title 数据集成服务类图
|
|
|
+skinparam style strictuml
|
|
|
|
|
|
-' 数据获取器
|
|
|
-class ApiDataFetcher {
|
|
|
- - apiEndpoint: String
|
|
|
- + fetchApiData(String url)
|
|
|
- + configureApiEndpoint(String endpoint)
|
|
|
-}
|
|
|
-class KafkaDataFetcher {
|
|
|
- - kafkaBroker: String
|
|
|
- - groupId: String
|
|
|
- + fetchKafkaData(String topic)
|
|
|
- + configureKafka(String broker, String groupId)
|
|
|
-}
|
|
|
-
|
|
|
-' 抽象处理器
|
|
|
-abstract class Handler {
|
|
|
- - dataFetcher: DataFetcher
|
|
|
- - dataCache: List<DataModel>
|
|
|
- + fetchData(): List<DataModel>
|
|
|
- + processData(List<DataModel> data): void
|
|
|
- + validateData(DataModel data): boolean
|
|
|
+class UserController {
|
|
|
+ +getUser(userId: Long): User
|
|
|
+ +createUser(user: User): User
|
|
|
+ +updateUser(userId: Long, user: User): User
|
|
|
+ +deleteUser(userId: Long): void
|
|
|
}
|
|
|
|
|
|
-' 具体处理器
|
|
|
-class AwarenessHandler
|
|
|
-class NetworkHandler
|
|
|
-class DcimHandler
|
|
|
-class CloudHandler
|
|
|
-class MonitoringHandler
|
|
|
-class CDOSHandler
|
|
|
-
|
|
|
-' 数据集成服务
|
|
|
-class IntegrationService {
|
|
|
- - handlers: List<Handler>
|
|
|
- + DataIntegrate()
|
|
|
- + registerHandler(Handler handler): void
|
|
|
- + scheduleIntegration(): void
|
|
|
- + generateReport(): String
|
|
|
+class UserService {
|
|
|
+ +findUserById(userId: Long): User
|
|
|
+ +saveUser(user: User): User
|
|
|
+ +updateUser(userId: Long, user: User): User
|
|
|
+ +removeUser(userId: Long): void
|
|
|
}
|
|
|
|
|
|
-' 数据库服务
|
|
|
-class DatabaseService {
|
|
|
- + saveData(data: List<DataModel>)
|
|
|
- + queryData(String condition): List<DataModel>
|
|
|
- + deleteData(String condition): void
|
|
|
- + updateData(DataModel newData): void
|
|
|
+class UserRepository {
|
|
|
+ +findById(userId: Long): User
|
|
|
+ +save(user: User): User
|
|
|
+ +deleteById(userId: Long): void
|
|
|
}
|
|
|
|
|
|
-' 数据模型
|
|
|
-class DataModel {
|
|
|
- + id: int
|
|
|
- + name: String
|
|
|
- + value: String
|
|
|
- + timestamp: String
|
|
|
- + source: String
|
|
|
+class User {
|
|
|
+ -id: Long
|
|
|
+ -name: String
|
|
|
+ -email: String
|
|
|
+ +getId(): Long
|
|
|
+ +setId(id: Long): void
|
|
|
+ +getName(): String
|
|
|
+ +setName(name: String): void
|
|
|
+ +getEmail(): String
|
|
|
+ +setEmail(email: String): void
|
|
|
}
|
|
|
|
|
|
-' 继承关系
|
|
|
-Handler <|-- AwarenessHandler
|
|
|
-Handler <|-- NetworkHandler
|
|
|
-Handler <|-- DcimHandler
|
|
|
-Handler <|-- CloudHandler
|
|
|
-Handler <|-- MonitoringHandler
|
|
|
-Handler <|-- CDOSHandler
|
|
|
-
|
|
|
-' 依赖关系
|
|
|
-Handler --> ApiDataFetcher : uses
|
|
|
-Handler --> KafkaDataFetcher : uses
|
|
|
-IntegrationService --> Handler : uses
|
|
|
-IntegrationService --> DatabaseService : stores
|
|
|
-DatabaseService --> DataModel : saves
|
|
|
-
|
|
|
+UserController --> UserService
|
|
|
+UserService --> UserRepository
|
|
|
+UserRepository --> User
|
|
|
@enduml
|