|
@@ -1,62 +1,81 @@
|
|
|
-# //陪聊部分
|
|
|
-# 类图
|
|
|
+# 简单版类图
|
|
|
```plantuml
|
|
|
-' 聊天项目类图英文版
|
|
|
@startuml
|
|
|
-
|
|
|
class _User {
|
|
|
- + objectId: String //用户唯一标识符
|
|
|
- + username: String //用户名
|
|
|
- + realname: String //真实姓名
|
|
|
- + password: String //用户密码
|
|
|
- + gender: String //性别
|
|
|
- + age: Number //年龄
|
|
|
- + email: String //用户邮箱
|
|
|
- + avatar: String //用户头像
|
|
|
- + startChat(): void
|
|
|
- + chooseChatPartner(): String
|
|
|
- + summarizeChatHistory(): void
|
|
|
+ + objectId: String
|
|
|
+ + username: String
|
|
|
+ + realname: String
|
|
|
+ + password: String
|
|
|
+ + gender: String
|
|
|
+ + age: Number
|
|
|
+ + email: String
|
|
|
+ + avatar: String
|
|
|
}
|
|
|
-
|
|
|
class ChatPartner {
|
|
|
- + objectId: String //陪聊师唯一标识符
|
|
|
- + name: String //陪聊师姓名
|
|
|
- + expertise: String //陪聊师专业领域
|
|
|
- + avatar: String //陪聊师头像
|
|
|
- + bio: String //陪聊师个人简介
|
|
|
- + provideChat(): String
|
|
|
+ + objectId: String
|
|
|
+ + name: String
|
|
|
+ + expertise: String
|
|
|
+ + avatar: String
|
|
|
+ + bio: String
|
|
|
}
|
|
|
-
|
|
|
class ChatCompanion {
|
|
|
- + objectId: String //聊天伙伴唯一标识符
|
|
|
- + name: String //聊天伙伴姓名
|
|
|
- + avatar: String //聊天伙伴头像
|
|
|
- + bio: String //聊天伙伴个人简介
|
|
|
- + provideChat(): String
|
|
|
+ + objectId: String
|
|
|
+ + name: String
|
|
|
+ + avatar: String
|
|
|
+ + bio: String
|
|
|
}
|
|
|
-
|
|
|
class ChatRecord {
|
|
|
- + objectId: String //聊天记录唯一标识符
|
|
|
- + title:String //聊天标题
|
|
|
- + content:Array //聊天内容
|
|
|
- + user: Pointer<User> //关联的用户对象
|
|
|
- + chatpartner: Pointer<ChatPartner> //关联的聊天机器人对象
|
|
|
- + getChatHistory(): List
|
|
|
+ + objectId: String
|
|
|
+ + title:String
|
|
|
+ + content:Array
|
|
|
+ + user: Pointer<User>
|
|
|
+ + chatpartner: Pointer<ChatPartner>
|
|
|
}
|
|
|
-
|
|
|
class ChatReport {
|
|
|
- + objectId: String //报告唯一标识符
|
|
|
- - report: String //分析结果
|
|
|
- + generateReport(): String //生成报告的方法
|
|
|
+ + objectId: String
|
|
|
+ - report: String
|
|
|
}
|
|
|
class ChatEvaluate{
|
|
|
- + objectId:String//评论唯一标识符
|
|
|
- + avater:String//用户头像
|
|
|
- + content:String//评论内容
|
|
|
- + rating:Number//评论星星数
|
|
|
- + user: Pointer<User> //关联的用户对象
|
|
|
+ + objectId:String
|
|
|
+ + avater:String
|
|
|
+ + content:String
|
|
|
+ + rating:Number
|
|
|
+ + user: Pointer<User>
|
|
|
}
|
|
|
-
|
|
|
+class PsychologicalCommunity {
|
|
|
+ + communityID: String
|
|
|
+ + topic: String
|
|
|
+}
|
|
|
+class PsychologicalActivity {
|
|
|
+ + activityID: String
|
|
|
+ + title: String
|
|
|
+ + description: String
|
|
|
+ + date: Date
|
|
|
+ + location: String
|
|
|
+}
|
|
|
+class PsychologicalSurvey {
|
|
|
+ + surveyID: String
|
|
|
+ + content: String
|
|
|
+ + publisher: SchoolAdmin
|
|
|
+ + responses: List
|
|
|
+}
|
|
|
+class SchoolAdmin {
|
|
|
+ + adminID: String
|
|
|
+ + name: String
|
|
|
+ + email: String
|
|
|
+}
|
|
|
+class Bottle {
|
|
|
+ + bottleID: String
|
|
|
+ + content: String
|
|
|
+ + author: User
|
|
|
+ + timestamp: Date
|
|
|
+}
|
|
|
+_User "1" -- "0..*" PsychologicalCommunity
|
|
|
+PsychologicalActivity "1" -- "0..*" _User
|
|
|
+SchoolAdmin "1" -- "0..*" PsychologicalActivity
|
|
|
+SchoolAdmin "1" -- "0..*" PsychologicalSurvey
|
|
|
+PsychologicalSurvey "1" -- "0..*" _User
|
|
|
+_User "1" -- "0..*" Bottle
|
|
|
_User "*" --> "*" ChatEvaluate
|
|
|
_User "1" --> "*" ChatRecord
|
|
|
ChatPartner "1" --> "*" ChatRecord
|
|
@@ -64,6 +83,8 @@ ChatCompanion "1" --> "*" ChatRecord
|
|
|
ChatRecord "1" --> "1" ChatReport
|
|
|
@enduml
|
|
|
```
|
|
|
+
|
|
|
+
|
|
|
# 时序图
|
|
|
```plantuml
|
|
|
@startuml
|
|
@@ -150,78 +171,6 @@ rectangle "心理社区" {
|
|
|
学校管理员 -- (设置星标用户)
|
|
|
}
|
|
|
|
|
|
-@enduml
|
|
|
-```
|
|
|
-# 类图
|
|
|
-
|
|
|
-```plantuml
|
|
|
-@startuml
|
|
|
-class User {
|
|
|
- +objectId: String
|
|
|
- +username: String
|
|
|
- +realname: String
|
|
|
- +password: String
|
|
|
- +gender: String
|
|
|
- +age: Number
|
|
|
- +email: String
|
|
|
- +avatar: String
|
|
|
- +startChat():void
|
|
|
- +chooseChatPartner():String
|
|
|
- +summarizeCharHistory():void
|
|
|
- +registerAccount():void
|
|
|
- +login(): void
|
|
|
- +fillPsychologicalTest(): void
|
|
|
- +publishBottle(): void
|
|
|
- +retrieveBottle(): Bottle
|
|
|
-}
|
|
|
-
|
|
|
-class PsychologicalCommunity {
|
|
|
- +communityID: String
|
|
|
- +topic: String
|
|
|
- +joinCommunity(): void
|
|
|
-}
|
|
|
-
|
|
|
-class PsychologicalActivity {
|
|
|
- +activityID: String
|
|
|
- +title: String
|
|
|
- +description: String
|
|
|
- +date: Date
|
|
|
- +location: String
|
|
|
- +publishActivity(): void
|
|
|
-}
|
|
|
-
|
|
|
-class PsychologicalSurvey {
|
|
|
- +surveyID: String
|
|
|
- +content: String
|
|
|
- +publisher: SchoolAdmin
|
|
|
- +responses: List
|
|
|
- +publishSurvey(): void
|
|
|
- +analyzeResults(): void
|
|
|
-}
|
|
|
-
|
|
|
-class SchoolAdmin {
|
|
|
- +adminID: String
|
|
|
- +name: String
|
|
|
- +email: String
|
|
|
- +publishPsychologicalActivity(): void
|
|
|
- +publishPsychologicalSurvey(): void
|
|
|
- +analyzeSurveyResults(): void
|
|
|
- +setFeaturedUser(): void
|
|
|
-}
|
|
|
-
|
|
|
-class Bottle {
|
|
|
- +bottleID: String
|
|
|
- +content: String
|
|
|
- +author: User
|
|
|
- +timestamp: Date
|
|
|
-}
|
|
|
-
|
|
|
-User "1" -- "0..*" PsychologicalCommunity
|
|
|
-PsychologicalActivity "1" -- "0..*" User
|
|
|
-SchoolAdmin "1" -- "0..*" PsychologicalActivity
|
|
|
-SchoolAdmin "1" -- "0..*" PsychologicalSurvey
|
|
|
-PsychologicalSurvey "1" -- "0..*" User
|
|
|
-User "1" -- "0..*" Bottle
|
|
|
@enduml
|
|
|
```
|
|
|
|