初版设计文档 #11

Merged
p5i4afnyx merged 1 commits from cxf into main 2 months ago

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

@ -0,0 +1,159 @@
@startuml
!theme vibrant
title ER Diagram for "OpenRank Database System"
entity "repos" as Repos {
-- Fields --
* id : BIGINT <<PK>>
platform : VARCHAR(32)
full_name : VARCHAR(255)
owner : VARCHAR(128)
name : VARCHAR(128)
language : VARCHAR(64)
description : TEXT
stars : INT
forks : INT
metadata : JSON
updated_at : DATETIME
}
entity "issues" as Issues {
-- Fields --
* id : BIGINT <<PK>>
platform : VARCHAR(32)
repo_id : BIGINT
repo_full_name : VARCHAR(255)
number : INT
title : TEXT
body_long : LONGTEXT
author_id : BIGINT
author_login : VARCHAR(128)
state : VARCHAR(32)
created_at : DATETIME
closed_at : DATETIME
labels : JSON
assignees : JSON
first_response_hours : INT
assignment_type : VARCHAR(32)
reactions : JSON
activities_count : INT
raw_payload : JSON
updated_at : DATETIME
}
entity "pull_requests" as PullRequests {
-- Fields --
* id : BIGINT <<PK>>
platform : VARCHAR(32)
repo_id : BIGINT
repo_full_name : VARCHAR(255)
number : INT
title : TEXT
body_long : LONGTEXT
author_id : BIGINT
author_login : VARCHAR(128)
state : VARCHAR(32)
created_at : DATETIME
merged_at : DATETIME
closed_at : DATETIME
labels : JSON
milestone_due : DATETIME
first_response_hours : INT
reactions : JSON
files_changed : INT
additions : INT
deletions : INT
test_files_changed : INT
coverage_delta : FLOAT
core_file_ratio : FLOAT
ci_status : VARCHAR(64)
change_requests : INT
reopened : TINYINT(1)
reverted : TINYINT(1)
activities_count : INT
raw_payload : JSON
updated_at : DATETIME
}
entity "activities" as Activities {
-- Fields --
* item_type : ENUM('issue','pr') <<PK>>
* item_id : BIGINT <<PK>>
* actor_id : BIGINT <<PK>>
platform : VARCHAR(32)
repo_id : BIGINT
item_number : INT
actor_login : VARCHAR(255)
open_count : INT
comment_count : INT
review_count : INT
close_count : INT
review_comment_count : INT
commit_count : INT
activity_meta : JSON
created_at : TIMESTAMP
updated_at : TIMESTAMP
}
entity "repo_events" as RepoEvents {
-- Fields --
* id : BIGINT <<PK>>
platform : VARCHAR(32)
repo_id : BIGINT
actor_id : BIGINT
actor_login : VARCHAR(128)
event_type : VARCHAR(32)
count : INT
event_time : DATETIME
created_at : DATETIME
}
entity "raw_payloads" as RawPayloads {
-- Fields --
* id : BIGINT <<PK>>
platform : VARCHAR(32)
repo_id : BIGINT
resource_type : VARCHAR(32)
resource_id : BIGINT
payload : JSON
fetched_at : DATETIME
}
entity "fetch_runs" as FetchRuns {
-- Fields --
* id : BIGINT <<PK>>
platform : VARCHAR(32)
repo_id : BIGINT
repo_full_name : VARCHAR(255)
source : ENUM('network','db')
start_time : DATETIME
end_time : DATETIME
start_date : DATE
end_date : DATE
token_used : TINYINT(1)
success : TINYINT(1)
note : TEXT
stats : JSON
created_at : DATETIME
issues : INT
pull_requests : INT
activities : INT
meta : JSON
}
' 关系定义一个仓库可以有多个issues、pull_requests、activities等
Repos ||--o{ Issues : "repo_id"}
Repos ||--o{ PullRequests : "repo_id"}
Repos ||--o{ Activities : "repo_id"}
Repos ||--o{ RepoEvents : "repo_id"}
Repos ||--o{ RawPayloads : "repo_id"}
Repos ||--o{ FetchRuns : "repo_id"}
' activities表通过复合主键关联issues和pull_requests
Issues ||--o{ Activities : "item_id (item_type='issue')"}
PullRequests ||--o{ Activities : "item_id (item_type='pr')"}
' fetch_runs表记录数据抓取任务与仓库关联
@enduml

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

@ -0,0 +1,58 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- algorithmController: AlgorithmController
- chartController: ChartController
+ startPage()
+ displayDataAndChart(data: ProjectData, chart: Chart)
+ openOpenRankSegment()
}
class AlgorithmController <<control>> {
- database: DateBase
+ getProjectData(): ProjectData
}
class ChartController <<control>> {
+ generateChart(data: ProjectData): Chart
}
class DateBase <<entity>> {
- projectData: List<ProjectData>
+ getProjectData(): ProjectData
}
class ProjectData <<entity>> {
- id: String
- name: String
- openRankData: List<Double>
+ getId(): String
+ getName(): String
+ getOpenRankData(): List<Double>
}
class Chart <<entity>> {
- type: String
- data: Object
- title: String
+ render(): void
+ getType(): String
}
' 关联关系
MainUI --> AlgorithmController : "调用"
MainUI --> ChartController : "调用"
AlgorithmController --> DateBase : "查询"
AlgorithmController ..> ProjectData : "返回"
ChartController ..> Chart : "生成"
DateBase "1" *-- "many" ProjectData : "包含"
@enduml

@ -0,0 +1,141 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- webUI: WebUI
+ startPage()
+ showMainInterface()
+ navigateToNetworkGraphPage()
}
class WebUI <<boundary>> {
- algorithmController: AlgorithmController
- chartController: ChartController
+ showNetworkGraphPage()
+ displayNetworkGraph(graph: NetworkGraph)
}
class AlgorithmController <<control>> {
- database: DateBase
+ getNetworkGraphData(): NetworkData
}
class ChartController <<control>> {
+ drawNetworkGraph(data: NetworkData): NetworkGraph
}
class DateBase <<entity>> {
- developerData: List<DeveloperData>
- projectData: List<ProjectData>
- relationshipData: List<RelationshipData>
+ getDeveloperData(): List<DeveloperData>
+ getProjectData(): List<ProjectData>
+ getRelationshipData(): List<RelationshipData>
}
class NetworkData <<entity>> {
- developers: List<DeveloperData>
- projects: List<ProjectData>
- relationships: List<RelationshipData>
+ getDevelopers(): List<DeveloperData>
+ getProjects(): List<ProjectData>
+ getRelationships(): List<RelationshipData>
}
class NetworkGraph <<entity>> {
- graphId: String
- graphType: String
- nodes: List<GraphNode>
- edges: List<GraphEdge>
- layout: GraphLayout
+ render(): void
+ exportAsImage(format: String): void
+ getGraphData(): Object
}
class DeveloperData <<entity>> {
- developerId: String
- name: String
- avatar: String
- projects: List<String>
+ getDeveloperId(): String
+ getName(): String
+ getProjects(): List<String>
}
class ProjectData <<entity>> {
- projectId: String
- name: String
- description: String
- contributors: List<String>
+ getProjectId(): String
+ getName(): String
+ getContributors(): List<String>
}
class RelationshipData <<entity>> {
- sourceId: String
- targetId: String
- relationshipType: String
- strength: double
+ getSourceId(): String
+ getTargetId(): String
+ getRelationshipType(): String
+ getStrength(): double
}
class GraphNode <<entity>> {
- nodeId: String
- nodeType: String
- label: String
- position: Point
- properties: Map<String, Object>
+ getNodeId(): String
+ getLabel(): String
+ getPosition(): Point
}
class GraphEdge <<entity>> {
- edgeId: String
- sourceNodeId: String
- targetNodeId: String
- weight: double
- label: String
+ getSourceNodeId(): String
+ getTargetNodeId(): String
+ getWeight(): double
}
class GraphLayout <<entity>> {
- layoutType: String
- parameters: Map<String, Object>
- nodePositions: Map<String, Point>
+ calculateLayout(nodes: List<GraphNode>, edges: List<GraphEdge>): void
+ getNodePosition(nodeId: String): Point
}
' 关联关系
MainUI --> WebUI : "跳转"
WebUI --> AlgorithmController : "调用"
WebUI --> ChartController : "调用"
AlgorithmController --> DateBase : "查询"
AlgorithmController ..> NetworkData : "返回"
ChartController ..> NetworkGraph : "生成"
DateBase "1" *-- "many" DeveloperData : "包含"
DateBase "1" *-- "many" ProjectData : "包含"
DateBase "1" *-- "many" RelationshipData : "包含"
NetworkData "1" *-- "many" DeveloperData : "包含"
NetworkData "1" *-- "many" ProjectData : "包含"
NetworkData "1" *-- "many" RelationshipData : "包含"
NetworkGraph "1" *-- "many" GraphNode : "包含"
NetworkGraph "1" *-- "many" GraphEdge : "包含"
NetworkGraph "1" *-- "1" GraphLayout : "使用"
@enduml

@ -0,0 +1,126 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- dateController: DateController
+ startPage()
+ showMainInterface()
+ displayPRData(prData: List<PullRequestData>)
+ displayIssueData(issueData: List<IssueData>)
}
class DateController <<control>> {
- githubApi: GithubApi
- database: DateBase
+ getProjectIssueData(): List<IssueData>
+ getProjectPRData(): List<PullRequestData>
+ storeIssueData(issueData: List<IssueData>): boolean
+ storePRData(prData: List<PullRequestData>): boolean
}
class GithubApi <<boundary>> {
- apiKey: String
- baseUrl: String
+ requestProjectIssueData(projectId: String): List<IssueData>
+ requestProjectPRData(projectId: String): List<PullRequestData>
+ authenticate(apiKey: String): boolean
}
class DateBase <<entity>> {
- issueData: List<IssueData>
- prData: List<PullRequestData>
- projects: List<Project>
+ storeIssueData(issueData: List<IssueData>): boolean
+ storePRData(prData: List<PullRequestData>): boolean
+ getIssueData(projectId: String): List<IssueData>
+ getPRData(projectId: String): List<PullRequestData>
}
class IssueData <<entity>> {
- issueId: String
- projectId: String
- title: String
- state: String
- creator: String
- createdAt: Date
- closedAt: Date
- labels: List<String>
- commentsCount: int
+ getIssueId(): String
+ getProjectId(): String
+ getState(): String
+ calculateDuration(): long
+ isClosed(): boolean
}
class PullRequestData <<entity>> {
- prId: String
- projectId: String
- title: String
- state: String
- author: String
- createdAt: Date
- mergedAt: Date
- closedAt: Date
- reviewComments: int
- commits: int
+ getPRId(): String
+ getProjectId(): String
+ getState(): String
+ isMerged(): boolean
+ calculateMergeTime(): long
}
class Project <<entity>> {
- projectId: String
- name: String
- repositoryUrl: String
- description: String
+ getProjectId(): String
+ getName(): String
+ getRepositoryUrl(): String
}
class IssueStatistics <<entity>> {
- projectId: String
- totalIssues: int
- openIssues: int
- closedIssues: int
- averageResolutionTime: double
- issueTrend: Map<Date, int>
+ calculateStatistics(issueData: List<IssueData>): void
+ getOpenIssueCount(): int
+ getClosedIssueCount(): int
}
class PRStatistics <<entity>> {
- projectId: String
- totalPRs: int
- openPRs: int
- mergedPRs: int
- averageMergeTime: double
- prTrend: Map<Date, int>
+ calculateStatistics(prData: List<PullRequestData>): void
+ getMergedPRCount(): int
+ getOpenPRCount(): int
}
' 关联关系
MainUI --> DateController : "调用"
DateController --> GithubApi : "请求数据"
DateController --> DateBase : "存储/查询"
GithubApi ..> IssueData : "返回"
GithubApi ..> PullRequestData : "返回"
DateBase "1" *-- "many" IssueData : "存储"
DateBase "1" *-- "many" PullRequestData : "存储"
DateBase "1" *-- "many" Project : "包含"
IssueStatistics ..> IssueData : "分析"
PRStatistics ..> PullRequestData : "分析"
@enduml

@ -0,0 +1,163 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- dateController: DateController
+ startPage()
+ showMainInterface()
+ displayDeveloperData(developerData: List<DeveloperData>)
+ displayRepositoryData(repositoryData: List<RepositoryData>)
}
class DateController <<control>> {
- githubApi: GithubApi
- database: DateBase
+ getProjectDeveloperData(): List<DeveloperData>
+ getRepositoryData(): List<RepositoryData>
+ storeProjectDeveloperData(developerData: List<DeveloperData>): boolean
+ storeRepositoryData(repositoryData: List<RepositoryData>): boolean
}
class GithubApi <<boundary>> {
- apiKey: String
- baseUrl: String
+ requestProjectDeveloperData(projectId: String): List<DeveloperData>
+ requestRepositoryData(projectId: String): List<RepositoryData>
+ authenticate(apiKey: String): boolean
}
class DateBase <<entity>> {
- developerData: List<DeveloperData>
- repositoryData: List<RepositoryData>
- organizations: List<Organization>
+ storeProjectDeveloperData(developerData: List<DeveloperData>): boolean
+ storeRepositoryData(repositoryData: List<RepositoryData>): boolean
+ getDeveloperData(projectId: String): List<DeveloperData>
+ getRepositoryData(organizationId: String): List<RepositoryData>
}
class DeveloperData <<entity>> {
- developerId: String
- username: String
- email: String
- organization: String
- repositories: List<String>
- joinDate: Date
+ getDeveloperId(): String
+ getUsername(): String
+ getOrganization(): String
+ getRepositories(): List<String>
}
class RepositoryData <<entity>> {
- repositoryId: String
- name: String
- description: String
- organization: String
- createdAt: Date
- lastUpdated: Date
- language: String
+ getRepositoryId(): String
+ getName(): String
+ getOrganization(): String
+ getLanguage(): String
}
class Organization <<entity>> {
- organizationId: String
- name: String
- description: String
- memberCount: int
- repositoryCount: int
+ getOrganizationId(): String
+ getName(): String
+ getMemberCount(): int
+ getRepositoryCount(): int
}
class DeveloperStatistics <<entity>> {
- organizationId: String
- totalDevelopers: int
- activeDevelopers: int
- newDevelopersThisMonth: int
- developerGrowthRate: double
- topLanguages: Map<String, int>
+ calculateStatistics(developerData: List<DeveloperData>): void
+ getTotalDevelopers(): int
+ getDeveloperGrowthRate(): double
}
class RepositoryStatistics <<entity>> {
- organizationId: String
- totalRepositories: int
- publicRepositories: int
- privateRepositories: int
- newRepositoriesThisMonth: int
- repositoryGrowthRate: double
- topLanguages: Map<String, int>
+ calculateStatistics(repositoryData: List<RepositoryData>): void
+ getTotalRepositories(): int
+ getRepositoryGrowthRate(): double
}
class LanguageStatistics <<entity>> {
- language: String
- developerCount: int
- repositoryCount: int
- popularityScore: double
+ getLanguage(): String
+ getDeveloperCount(): int
+ getRepositoryCount(): int
+ calculatePopularityScore(): double
}
' 关联关系
MainUI --> DateController : "调用"
DateController --> GithubApi : "请求数据"
DateController --> DateBase : "存储/查询"
GithubApi ..> DeveloperData : "返回"
GithubApi ..> RepositoryData : "返回"
DateBase "1" *-- "many" DeveloperData : "存储"
DateBase "1" *-- "many" RepositoryData : "存储"
DateBase "1" *-- "many" Organization : "包含"
DeveloperStatistics ..> DeveloperData : "分析"
RepositoryStatistics ..> RepositoryData : "分析"
LanguageStatistics ..> DeveloperData : "关联"
LanguageStatistics ..> RepositoryData : "关联"
note right of DateController::getProjectDeveloperData
获取项目开发者数据
包括从API获取和存储
end note
note right of DateController::getRepositoryData
获取仓库数据
包括从API获取和存储
end note
note right of GithubApi::requestProjectDeveloperData
调用GitHub API
获取项目开发者数据
end note
note right of GithubApi::requestRepositoryData
调用GitHub API
获取仓库数据
end note
note right of DeveloperStatistics::calculateStatistics
计算开发者统计信息
包括数量和增长率
end note
note right of RepositoryStatistics::calculateStatistics
计算仓库统计信息
包括数量和增长率
end note
@enduml

@ -0,0 +1,143 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- dateController: DateController
+ startPage()
+ showMainInterface()
+ displayCommitData(commitData: List<CommitData>)
+ displayRepositoryStarData(starData: List<RepositoryStarData>)
}
class DateController <<control>> {
- githubApi: GithubApi
- database: DateBase
+ getRepositoryStarData(): List<RepositoryStarData>
+ getCommitData(): List<CommitData>
+ storeRepositoryStarData(starData: List<RepositoryStarData>): boolean
+ storeCommitData(commitData: List<CommitData>): boolean
}
class GithubApi <<boundary>> {
- apiKey: String
- baseUrl: String
+ requestRepositoryStarData(projectId: String): List<RepositoryStarData>
+ requestCommitData(projectId: String): List<CommitData>
+ authenticate(apiKey: String): boolean
}
class DateBase <<entity>> {
- repositoryStarData: List<RepositoryStarData>
- commitData: List<CommitData>
- projects: List<Project>
+ storeRepositoryStarData(starData: List<RepositoryStarData>): boolean
+ storeCommitData(commitData: List<CommitData>): boolean
+ getRepositoryStarData(projectId: String): List<RepositoryStarData>
+ getCommitData(projectId: String): List<CommitData>
}
class RepositoryStarData <<entity>> {
- repositoryId: String
- starCount: int
- stargazers: List<Stargazer>
- starHistory: Map<Date, int>
- date: Date
+ getRepositoryId(): String
+ getStarCount(): int
+ getStargazers(): List<Stargazer>
+ calculateStarGrowth(startDate: Date, endDate: Date): int
}
class CommitData <<entity>> {
- commitId: String
- repositoryId: String
- author: String
- date: Date
- message: String
- filesChanged: int
- linesAdded: int
- linesDeleted: int
+ getCommitId(): String
+ getRepositoryId(): String
+ getAuthor(): String
+ getDate(): Date
+ getChangeSummary(): String
}
class Project <<entity>> {
- projectId: String
- name: String
- repositoryUrl: String
- description: String
+ getProjectId(): String
+ getName(): String
+ getRepositoryUrl(): String
}
class Stargazer <<entity>> {
- userId: String
- username: String
- starredAt: Date
+ getUserId(): String
+ getUsername(): String
+ getStarredAt(): Date
}
class StarStatistics <<entity>> {
- repositoryId: String
- totalStars: int
- starsThisMonth: int
- starsThisYear: int
- starGrowthRate: double
- topStargazers: List<Stargazer>
+ calculateStatistics(starData: List<RepositoryStarData>): void
+ getStarGrowthRate(): double
+ getTopStargazers(count: int): List<Stargazer>
}
class CommitStatistics <<entity>> {
- repositoryId: String
- totalCommits: int
- commitsThisMonth: int
- commitsThisYear: int
- topContributors: List<Contributor>
- commitFrequency: Map<Date, int>
+ calculateStatistics(commitData: List<CommitData>): void
+ getTotalCommits(): int
+ getTopContributors(count: int): List<Contributor>
}
class Contributor <<entity>> {
- contributorId: String
- username: String
- commitCount: int
- firstCommit: Date
- lastCommit: Date
+ getContributorId(): String
+ getUsername(): String
+ getCommitCount(): int
+ getActivityPeriod(): TimeSpan
}
' 关联关系
MainUI --> DateController : "调用"
DateController --> GithubApi : "请求数据"
DateController --> DateBase : "存储/查询"
GithubApi ..> RepositoryStarData : "返回"
GithubApi ..> CommitData : "返回"
DateBase "1" *-- "many" RepositoryStarData : "存储"
DateBase "1" *-- "many" CommitData : "存储"
DateBase "1" *-- "many" Project : "包含"
RepositoryStarData "1" *-- "many" Stargazer : "包含"
StarStatistics ..> RepositoryStarData : "分析"
CommitStatistics ..> CommitData : "分析"
CommitStatistics "1" *-- "many" Contributor : "统计"
@enduml

@ -0,0 +1,102 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- codehubUI: CodehubUI
+ startPage()
+ showMainInterface()
+ navigateToRepositoryAnalysis()
}
class CodehubUI <<boundary>> {
- algorithmController: AlgorithmController
+ showRepositoryAnalysisPage()
+ displayRepositoryAnalysisResult(result: RepositoryAnalysisResult)
}
class AlgorithmController <<control>> {
- database: DateBase
- pylint: Pylint
+ getRepositoryCodeData(): RepositoryAnalysisResult
}
class Pylint <<control>> {
+ analyzeRepository(codeData: RepositoryCodeData): RepositoryAnalysisResult
}
class DateBase <<entity>> {
- repositoryData: List<RepositoryCodeData>
+ getRepositoryCodeData(): RepositoryCodeData
}
class RepositoryCodeData <<entity>> {
- repositoryId: String
- repositoryName: String
- codeFiles: List<CodeFile>
- commitHistory: List<Commit>
- contributors: List<Contributor>
+ getRepositoryId(): String
+ getRepositoryName(): String
+ getCodeFiles(): List<CodeFile>
+ getCommitHistory(): List<Commit>
}
class RepositoryAnalysisResult <<entity>> {
- repositoryId: String
- repositoryName: String
- qualityScore: double
- activityScore: double
- communityScore: double
- overallScore: double
- analysisMetrics: Map<String, Object>
+ getOverallScore(): double
+ getDetailedScores(): Map<String, double>
+ generateReport(): String
}
class CodeFile <<entity>> {
- fileName: String
- filePath: String
- language: String
- size: long
- complexity: int
+ getComplexity(): int
+ getLanguage(): String
}
class Commit <<entity>> {
- commitId: String
- author: String
- date: Date
- message: String
- changes: int
+ getAuthor(): String
+ getChanges(): int
}
class Contributor <<entity>> {
- contributorId: String
- name: String
- commitCount: int
+ getCommitCount(): int
}
' 关联关系
MainUI --> CodehubUI : "跳转"
CodehubUI --> AlgorithmController : "调用"
AlgorithmController --> DateBase : "查询"
AlgorithmController --> Pylint : "委托分析"
Pylint ..> RepositoryAnalysisResult : "生成"
DateBase "1" *-- "many" RepositoryCodeData : "包含"
RepositoryCodeData "1" *-- "many" CodeFile : "包含"
RepositoryCodeData "1" *-- "many" Commit : "包含"
RepositoryCodeData "1" *-- "many" Contributor : "包含"
@enduml

@ -0,0 +1,76 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- developerUI: DeveloperUI
+ startPage()
+ showMainInterface()
+ navigateToDeveloperAnalysis()
}
class DeveloperUI <<boundary>> {
- algorithmController: AlgorithmController
+ showDeveloperAnalysisPage()
+ displayDeveloperAnalysisResult(result: DeveloperAnalysisResult)
}
class AlgorithmController <<control>> {
- database: DateBase
+ getDeveloperContributionData(): DeveloperAnalysisResult
}
class DateBase <<entity>> {
- developerData: List<DeveloperData>
+ getDeveloperData(): DeveloperData
}
class DeveloperData <<entity>> {
- developerId: String
- developerName: String
- contributions: List<Contribution>
- commitCount: int
- codeLines: int
+ getDeveloperId(): String
+ getDeveloperName(): String
+ getContributions(): List<Contribution>
+ calculateContributionScore(): double
}
class DeveloperAnalysisResult <<entity>> {
- developerId: String
- developerName: String
- contributionScore: double
- analysisDetails: Map<String, Object>
- ranking: int
+ getContributionScore(): double
+ getAnalysisDetails(): Map<String, Object>
+ getRanking(): int
+ generateReport(): String
}
class Contribution <<entity>> {
- type: String
- value: double
- date: Date
+ getType(): String
+ getValue(): double
+ getDate(): Date
}
' 关联关系
MainUI --> DeveloperUI : "跳转"
DeveloperUI --> AlgorithmController : "调用"
AlgorithmController --> DateBase : "查询"
AlgorithmController ..> DeveloperAnalysisResult : "生成"
DateBase "1" *-- "many" DeveloperData : "包含"
DeveloperData "1" *-- "many" Contribution : "包含"
DeveloperAnalysisResult ..> DeveloperData : "基于"
@enduml

@ -0,0 +1,94 @@
@startuml
skinparam class {
BackgroundColor<<boundary>> LightSkyBlue
BackgroundColor<<control>> LightGreen
BackgroundColor<<entity>> Gold
}
class MainUI <<boundary>> {
- configUI: ConfigUI
+ startPage()
+ showMainInterface()
+ navigateToSystemConfigPage()
}
class ConfigUI <<boundary>> {
- algorithmController: AlgorithmController
- currentConfig: SystemConfig
+ showSystemConfigPage()
+ displayModificationSuccess(message: String)
+ modifyAlgorithmParameters(params: Map<String, Object>)
}
class AlgorithmController <<control>> {
- database: DateBase
+ modifyAlgorithmParameters(params: Map<String, Object>): boolean
+ getCurrentConfig(): SystemConfig
}
class DateBase <<entity>> {
- systemConfig: SystemConfig
- configHistory: List<ConfigHistory>
+ getSystemConfig(): SystemConfig
+ updateSystemConfig(config: SystemConfig): boolean
+ saveConfigHistory(history: ConfigHistory): boolean
}
class SystemConfig <<entity>> {
- configId: String
- version: String
- parameters: Map<String, Object>
- lastModified: Date
- modifiedBy: String
+ getParameter(key: String): Object
+ setParameter(key: String, value: Object): void
+ getAllParameters(): Map<String, Object>
+ validateParameters(): boolean
}
class ConfigHistory <<entity>> {
- historyId: String
- configId: String
- oldValues: Map<String, Object>
- newValues: Map<String, Object>
- modifiedBy: String
- modificationTime: Date
+ getChangeDescription(): String
+ rollback(): SystemConfig
}
class AlgorithmParameter <<entity>> {
- parameterName: String
- parameterType: String
- defaultValue: Object
- minValue: Object
- maxValue: Object
- description: String
+ validateValue(value: Object): boolean
+ getDescription(): String
}
class User <<entity>> {
- userId: String
- username: String
- role: String
- permissions: List<String>
+ getUserId(): String
+ getUsername(): String
+ hasPermission(permission: String): boolean
}
' 关联关系
MainUI --> ConfigUI : "跳转"
ConfigUI --> AlgorithmController : "调用"
AlgorithmController --> DateBase : "更新"
DateBase "1" *-- "1" SystemConfig : "当前配置"
DateBase "1" *-- "many" ConfigHistory : "配置历史"
SystemConfig "1" *-- "many" AlgorithmParameter : "包含参数"
ConfigHistory ..> SystemConfig : "关联"
ConfigHistory ..> User : "记录操作者"
@enduml
Loading…
Cancel
Save