csdn1233 3 månader sedan
förälder
incheckning
1f9534325e

+ 4 - 4
AIart-app/package-lock.json

@@ -22,7 +22,7 @@
         "@capacitor/keyboard": "6.0.3",
         "@capacitor/status-bar": "6.0.2",
         "@ionic/angular": "^8.0.0",
-        "fmode-ng": "^0.0.62",
+        "fmode-ng": "^0.0.63",
         "ionicons": "^7.2.1",
         "rxjs": "~7.8.0",
         "swiper": "^11.1.15",
@@ -10379,9 +10379,9 @@
       "license": "ISC"
     },
     "node_modules/fmode-ng": {
-      "version": "0.0.62",
-      "resolved": "https://registry.npmmirror.com/fmode-ng/-/fmode-ng-0.0.62.tgz",
-      "integrity": "sha512-F0RzEu47NgKpaHp/vBEzjsU4efJ1lKLAbbdPE5hltj1W1cDaeht/i6UlEidid4FAEdAg7c9rrQrLgOh/zUfCsg==",
+      "version": "0.0.63",
+      "resolved": "https://registry.npmmirror.com/fmode-ng/-/fmode-ng-0.0.63.tgz",
+      "integrity": "sha512-gTiDZO2CchcTYAmlaweapasqV/8PdhG2vizJNn5dYZyXjgtrjyW+KeW5k2EVyIDvM1+bMGjjhGmr76Fc0TElxw==",
       "license": "COPYRIGHT © 未来飞马 未来全栈 www.fmode.cn All RIGHTS RESERVED",
       "dependencies": {
         "tslib": "^2.3.0"

+ 1 - 1
AIart-app/package.json

@@ -27,7 +27,7 @@
     "@capacitor/keyboard": "6.0.3",
     "@capacitor/status-bar": "6.0.2",
     "@ionic/angular": "^8.0.0",
-    "fmode-ng": "^0.0.62",
+    "fmode-ng": "^0.0.63",
     "ionicons": "^7.2.1",
     "rxjs": "~7.8.0",
     "swiper": "^11.1.15",

+ 28 - 0
AIart-app/src/agent/agent.task.ts

@@ -0,0 +1,28 @@
+
+interface AgentTaskStepOptions {
+    title: string
+    shareData?: any
+    handle?: { (): Promise<any> }
+}
+export class AgentTaskStep {
+    title: string = ""
+    shareData: any = {}
+    data: any = {}
+
+    parentComp: any | undefined
+    parentIndex: number | undefined
+    constructor(metaData: AgentTaskStepOptions) {
+        this.title = metaData?.title
+        this.shareData = metaData?.shareData
+        // this.handle = metaData?.handle
+    }
+    onInit() {
+
+    }
+    onProgress() {
+
+    }
+    onComplete() {
+
+    }
+}   

+ 7 - 1
AIart-app/src/app/interest-test/interest-test.component.html

@@ -28,7 +28,13 @@
     }
 
     @if(isComplete){
-    <fm-markdown-preview [content]="responseMsg"></fm-markdown-preview>
+    <div style="margin-left: 20px;margin-right: 20px;">
+        <fm-markdown-preview [content]="responseMsg"></fm-markdown-preview>
+    </div>
+    <div style="display: flex;align-items: center;justify-content: center;">
+        <ion-button (click)="makeMindMap()" style="width: 90%;">开始制作学习思维导图</ion-button>
+    </div>
+
     }
 
 </ion-content>

+ 5 - 3
AIart-app/src/app/interest-test/interest-test.component.ts

@@ -32,9 +32,9 @@ export class InterestTestComponent implements OnInit {
   // 方法:实例化completion对象,传入消息数组,并订阅生成的可观察对象。
   isComplete: boolean = false;
   sendMessage() {
-    console.log("create")
+    console.log("开始制定学习计划")
     let PromptTemplate = `
-    您作为一名专业的${this.department}兴趣规划师,请根据用户的描述,给出初步的实现方案并给出一些建议,
+    您作为一名专业的${this.department}兴趣规划师,请根据用户的描述,分点给出初步的实现方案并给出一些建议,
     以下是用户的描述${this.userPrompt}
     `
     let completion = new FmodeChatCompletion([
@@ -51,5 +51,7 @@ export class InterestTestComponent implements OnInit {
       )
     })
   }
-
+  makeMindMap() {
+    console.log("开始生成思维导图")
+  }
 }

+ 411 - 0
AIart-prod/communitySharing.md

@@ -0,0 +1,411 @@
+# 社区分享模块描述
+## 作品展示与交流模块
+***功能描述***
+
+该模块为用户提供一个平台,用于展示和交流在课程学习过程中完成的作品。用户可以上传各种类型的作品(如绘画、手工艺、编程代码、摄影等),并与其他用户进行互动。
+
+***主要功能***
+
+1、**作品上传**
+
+- 用户可以通过简单的界面上传自己的作品。
+- 支持多种文件格式和类型,确保多样性。
+
+2、**作品分类**
+
+- 作品根据类型进行分类(如绘画、手工艺、编程、摄影等),方便用户浏览。
+- 每个分类下可以显示最新作品和热门作品。
+
+3、**浏览与互动**
+
+- 用户可以浏览其他用户的作品,并进行点赞、评论。
+- 提供搜索功能,用户可以根据关键词快速找到感兴趣的作品。
+
+4、**热门作品推荐**
+
+- 系统根据点赞和评论数量,推荐热门作品给用户,提升作品曝光率。
+## 学习经验分享模块
+***功能描述***
+- 该模块鼓励用户分享自己的学习经验和技巧,促进用户之间的知识交流和互助。
+
+***主要功能***
+
+1、**经验分享发布**
+
+- 用户可以发布文字帖子、图片或视频,分享学习心得、技巧等。
+- 提供编辑器,支持基本的文本格式化。
+
+2、**经验浏览与互动**
+
+- 用户可以浏览其他用户的分享内容,进行点赞和评论。
+- 提供分类标签,用户可以根据主题快速找到相关经验分享。
+
+3、**困难与解决方案分享**
+
+- 用户可以分享在学习过程中遇到的困难以及解决方法,促进经验的传承和交流。
+
+4、**学习成果展示**
+
+- 用户可以分享学习成果,展示自己的进步和成就,激励其他用户。
+
+# 具体范式设计
+## Parse Schema 设计
+1、**作品表 (Artwork)**
+
+- objectId: 唯一标识符
+- userId: 上传用户的ID
+- title: 作品标题
+- description: 作品描述
+- category: 作品分类
+- fileUrl: 作品文件链接
+- likesCount: 点赞数量
+- commentsCount: 评论数量
+- createdAt: 创建时间
+- updatedAt: 更新时间
+
+2、**评论表 (Comment)**
+
+- objectId: 唯一标识符
+- artworkId: 关联的作品ID
+- userId: 评论用户的ID
+- content: 评论内容
+- createdAt: 创建时间
+
+3、**经验分享表 (ExperienceShare)**
+
+- objectId: 唯一标识符
+- userId: 发布用户的ID
+- title: 分享标题
+- content: 分享内容
+- mediaUrl: 附加的图片或视频链接
+- likesCount: 点赞数量
+- commentsCount: 评论数量
+- createdAt: 创建时间
+- updatedAt: 更新时间
+
+4、**经验评论表 (ExperienceComment)**
+
+- objectId: 唯一标识符
+- experienceId: 关联的经验分享ID
+- userId: 评论用户的ID
+- content: 评论内容
+- createdAt: 创建时间
+
+5、**用户表 (User)**
+- objectId: 唯一标识符
+- username: 用户名
+- password: 密码
+- email: 用户邮箱
+- profilePictureUrl: 用户头像链接
+- createdAt: 创建时间
+- updatedAt: 更新时间
+
+# PlantUML 类图表示
+以下是使用PlantUML表示的类图:
+```plantuml
+@startuml
+class User {
+    +objectId: String
+    +username: String
+    +password: String
+    +email: String
+    +profilePictureUrl: String
+    +createdAt: Date
+    +updatedAt: Date
+}
+
+class Artwork {
+    +objectId: String
+    +userId: Pointer
+    +title: String
+    +description: String
+    +category: String
+    +fileUrl: String
+    +likesCount: Number
+    +commentsCount: Number
+    +createdAt: Date
+    +updatedAt: Date
+}
+
+class Comment {
+    +objectId: String
+    +artworkId: Pointer
+    +userId: Pointer
+    +content: String
+    +createdAt: Date
+}
+
+class ExperienceShare {
+    +objectId: String
+    +userId: Pointer
+    +title: String
+    +content: String
+    +mediaUrl: String
+    +likesCount: Number
+    +commentsCount: Number
+    +createdAt: Date
+    +updatedAt: Date
+}
+
+class ExperienceComment {
+    +objectId: String
+    +experienceId: Pointer
+    +userId: Pointer
+    +content: String
+    +createdAt: Date
+}
+
+User "1" -- "*" Artwork : uploads
+User "1" -- "*" Comment : writes
+User "1" -- "*" ExperienceShare : shares
+User "1" -- "*" ExperienceComment : comments
+Artwork "1" -- "*" Comment : contains
+ExperienceShare "1" -- "*" ExperienceComment : contains
+@enduml
+```
+# 设计说明
+- 用户表 (User):用户表用于存储用户的基本信息,包括用户名、密码、邮箱和头像链接。字段的设计考虑了用户在平台上的基本需求。
+- 外键关联:在 Artwork、Comment、ExperienceShare 和 ExperienceComment 表中,userId 字段指向 User 表,以确保用户与其作品和评论之间的关联。
+- 安全性:密码字段应进行加密存储,以确保用户信息的安全性。
+- 数据完整性:通过外键关联,确保用户在上传作品和分享经验时,其身份信息是完整且可追溯的。
+
+通过增加用户表,整个社区分享模块的结构变得更加完善,能够支持用户的多样化需求,并确保数据的完整性和安全性。
+# 业务逻辑描述
+# 作品展示与交流和学习经验分享的完整逻辑
+## 作品展示与交流生成逻辑
+
+**生成逻辑**
+
+1、**用户输入:**
+
+- 用户上传的作品信息(包括标题、描述、分类、文件链接等)。
+
+2、**作品上传:**
+
+- 用户通过简单的界面上传自己的作品。
+数据存储到 Artwork 表中。
+
+3、**作品分类:**
+
+- 作品根据类型进行分类(如绘画、手工艺、编程、摄影等)。
+
+4、**浏览与互动:**
+
+- 用户可以浏览其他用户的作品,进行点赞和评论。
+- 提供搜索功能,用户可以根据关键词快速找到感兴趣的作品。
+
+5、**热门作品推荐:**
+
+- 系统根据点赞和评论数量,推荐热门作品给用户。
+
+**结果存储:**
+
+**Artwork 表**
+- objectId: 唯一标识符
+- userId: 上传用户的ID
+- title: 作品标题
+- description: 作品描述
+- category: 作品分类
+- fileUrl: 作品文件链接
+- likesCount: 点赞数量
+- commentsCount: 评论数量
+- createdAt: 创建时间
+- updatedAt: 更新时间
+## 学习经验分享生成逻辑
+**功能描述**
+- 该模块鼓励用户分享自己的学习经验和技巧,促进用户之间的知识交流和互助。
+
+**生成逻辑**
+
+1、**用户输入:**
+
+- 用户发布的学习经验信息(包括标题、内容、媒体链接等)。
+
+2、**经验分享发布:**
+
+- 用户可以发布文字帖子、图片或视频,分享学习心得、技巧等。
+- 数据存储到 ExperienceShare 表中。
+
+3、**经验浏览与互动:**
+
+- 用户可以浏览其他用户的分享内容,进行点赞和评论。
+
+4、**困难与解决方案分享:**
+
+- 用户可以分享在学习过程中遇到的困难以及解决方法。
+
+5、**学习成果展示:**
+
+- 用户可以分享学习成果,展示自己的进步和成就。
+
+**结果存储:**
+
+**ExperienceShare 表**
+- objectId: 唯一标识符
+- userId: 发布用户的ID
+- title: 分享标题
+- content: 分享内容
+- mediaUrl: 附加的图片或视频链接
+- likesCount: 点赞数量
+- commentsCount: 评论数量
+- createdAt: 创建时间
+- updatedAt: 更新时间
+
+## JSON 格式的测试数据
+```json
+[
+    {
+        "Artwork": {
+            "objectId": "artwork1",
+            "userId": "user1",
+            "title": "Abstract Painting",
+            "description": "An abstract representation of emotions.",
+            "category": "Painting",
+            "fileUrl": "https://example.com/artwork/abstract_painting.jpg",
+            "likesCount": 15,
+            "commentsCount": 3,
+            "createdAt": "2024-01-15T10:00:00Z",
+            "updatedAt": "2024-01-15T10:00:00Z"
+        }
+    },
+    {
+        "Artwork": {
+            "objectId": "artwork2",
+            "userId": "user2",
+            "title": "Handmade Pottery",
+            "description": "A beautifully crafted pottery piece.",
+            "category": "Craft",
+            "fileUrl": "https://example.com/artwork/handmade_pottery.jpg",
+            "likesCount": 10,
+            "commentsCount": 1,
+            "createdAt": "2024-01-16T11:00:00Z",
+            "updatedAt": "2024-01-16T11:00:00Z"
+        }
+    },
+    {
+        "Artwork": {
+            "objectId": "artwork3",
+            "userId": "user3",
+            "title": "Nature Photography",
+            "description": "Capturing the beauty of nature during sunset.",
+            "category": "Photography",
+            "fileUrl": "https://example.com/artwork/nature_photography.jpg",
+            "likesCount": 20,
+            "commentsCount": 5,
+            "createdAt": "2024-01-17T12:00:00Z",
+            "updatedAt": "2024-01-17T12:00:00Z"
+        }
+    },
+    {
+        "ExperienceShare": {
+            "objectId": "experience1",
+            "userId": "user1",
+            "title": "My Journey in Painting",
+            "content": "I started painting last year and it has been an incredible journey. Here are some tips I learned along the way.",
+            "mediaUrl": "https://example.com/experience/painting_journey.jpg",
+            "likesCount": 12,
+            "commentsCount": 4,
+            "createdAt": "2024-02-01T10:00:00Z",
+            "updatedAt": "2024-02-01T10:00:00Z"
+        }
+    },
+    {
+        "ExperienceShare": {
+            "objectId": "experience2",
+            "userId": "user2",
+            "title": "Crafting Techniques",
+            "content": "Sharing some techniques I learned while crafting pottery.",
+            "mediaUrl": "https://example.com/experience/crafting_techniques.jpg",
+            "likesCount": 8,
+            "commentsCount": 2,
+            "createdAt": "2024-02-02T11:00:00Z",
+            "updatedAt": "2024-02-02T11:00:00Z"
+        }
+    },
+    {
+        "ExperienceShare": {
+            "objectId": "experience3",
+            "userId": "user3",
+            "title": "Photography Basics",
+            "content": "Here are some basic tips for taking great photos.",
+            "mediaUrl": "https://example.com/experience/photography_basics.jpg",
+            "likesCount": 15,
+            "commentsCount": 6,
+            "createdAt": "2024-02-03T12:00:00Z",
+            "updatedAt": "2024-02-03T12:00:00Z"
+        }
+    }
+]
+```
+
+# 作品展示与交流模块的业务执行逻辑
+- 用户在作品展示页面加载所有作品
+    - 用户浏览作品
+        - 用户主动点赞或评论作品
+            - 作品标记为热门
+```plantuml
+@startuml
+actor 用户
+participant "系统" as 系统
+participant "作品表" as 作品数据库
+
+用户 -> 系统: 上传作品(标题、描述、分类、文件链接)
+系统 -> 作品数据库: 存储作品数据
+系统 -> 作品数据库: 对作品进行分类
+系统 -> 用户: 确认上传成功
+
+用户 -> 系统: 浏览作品
+系统 -> 作品数据库: 加载所有作品
+系统 -> 用户: 显示作品(按分类、点赞、评论排序)
+
+用户 -> 系统: 点赞作品
+系统 -> 作品数据库: 更新点赞数量
+系统 -> 作品数据库: 更新评论数量
+
+用户 -> 系统: 评论作品
+系统 -> 作品数据库: 存储评论数据
+系统 -> 作品数据库: 更新评论数量
+
+系统 -> 作品数据库: 评估作品的热门程度
+系统 -> 用户: 推荐热门作品
+@enduml
+```
+
+```plantuml
+@startuml
+@startuml
+actor 用户
+participant "系统" as 系统
+participant "作品表" as 作品数据库
+participant "评论表" as 评论数据库
+
+用户 -> 系统: 加载所有作品
+系统 -> 作品数据库: 获取作品
+系统 -> 用户: 显示作品
+
+用户 -> 系统: 浏览作品
+系统 -> 用户: 显示作品详情
+
+用户 -> 系统: 点赞作品
+系统 -> 作品数据库: 更新点赞数量
+
+用户 -> 系统: 评论作品
+系统 -> 评论数据库: 存储评论数据
+系统 -> 作品数据库: 更新评论数量
+
+系统 -> 作品数据库: 评估热门作品
+系统 -> 用户: 显示热门作品
+@enduml
+```
+# 说明
+1、**生成逻辑时序图:**
+
+用户上传作品后,系统将作品信息存储到作品表中,并进行分类。
+用户可以浏览作品,系统从数据库加载所有作品并按要求排序。
+用户可以选择点赞或评论,系统相应地更新作品的点赞和评论数量,并定期评估热门作品。
+
+2、**业务执行逻辑时序图:**
+
+用户在作品展示页面加载所有作品,系统从数据库获取数据并展示。
+用户可以浏览作品详情,进行点赞和评论操作。
+系统在用户进行互动后,更新相应的数据,并评估哪些作品是热门作品。